summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2010-11-17 00:10:15 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2010-11-17 00:10:15 +0100
commit0a7d381bc78283d31356743c0b315bfae7ecb284 (patch)
treef3a8b3e48e2da334d121fddae3ee03fe427c665e
parent98b2ff68d82090bc0ec951a499580a682e4adff3 (diff)
downloadChimère-1.0.1.tar.bz2
Chimère-1.0.1.zip
Zoom on an object designed in a tiny urlv1.0.1
-rw-r--r--chimere/main/views.py4
-rw-r--r--chimere/static/main_map.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/chimere/main/views.py b/chimere/main/views.py
index 593331a..1f0e238 100644
--- a/chimere/main/views.py
+++ b/chimere/main/views.py
@@ -243,13 +243,13 @@ def getDetail(request, area_name, marker_id):
if request.method == 'GET':
if 'simple' in request.GET and request.GET['simple']:
response_dct['simple'] = True
- parameters = u'current_feature=' + marker_id
+ parameters = u'current_feature=%s' % marker_id
+ parameters += u"&checked_categories=%d" % marker.subcategory.id
net_dct = getTinyfiedUrl(parameters, area_name)
share_networks = []
for network in settings.SHARE_NETWORKS:
share_networks.append((network[0], network[1] % net_dct, network[2]))
response_dct['share_networks'] = share_networks
- print response_dct
return render_to_response('detail.html', response_dct)
def getDescriptionDetail(request, area_name, category_id):
diff --git a/chimere/static/main_map.js b/chimere/static/main_map.js
index cd770ae..c56f8a6 100644
--- a/chimere/static/main_map.js
+++ b/chimere/static/main_map.js
@@ -245,6 +245,7 @@ function updateCategories(response){
/* load geo objects with an AJAX request */
function loadGeoObjects(){
if (!first){ updateCheckedCategories(); }
+ else if (p_checked_categories){checked_categories = p_checked_categories;}
first = false;
/* 0 stand for all categories */
if (!checked_categories) checked_categories = '0';
@@ -369,6 +370,7 @@ function putMarker(layer, mark) {
showPop(feature);
clicked = true;
updateDetail(feature.pk);
+ map.setCenter(feature.lonlat, 17);
p_current_feature = null;
}
return feature;