diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-05-07 23:59:40 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-05-07 23:59:40 +0200 |
commit | 5e565a725f30227d44f1a499f76c86eebdd73ed2 (patch) | |
tree | 523af5492c7943780b08ebd16ba5c14032b3edf6 /chimere | |
parent | 8d0a2dddb9797f993fd0149b55aa5aeabafd07cc (diff) | |
download | Chimère-5e565a725f30227d44f1a499f76c86eebdd73ed2.tar.bz2 Chimère-5e565a725f30227d44f1a499f76c86eebdd73ed2.zip |
Fix share of markers
Diffstat (limited to 'chimere')
-rw-r--r-- | chimere/static/chimere/js/jquery.chimere.js | 8 | ||||
-rw-r--r-- | chimere/templates/chimere/blocks/map_params.html | 4 | ||||
-rw-r--r-- | chimere/templatetags/chimere_tags.py | 8 |
3 files changed, 11 insertions, 9 deletions
diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js index 5c5fbec..3c1e321 100644 --- a/chimere/static/chimere/js/jquery.chimere.js +++ b/chimere/static/chimere/js/jquery.chimere.js @@ -227,7 +227,7 @@ See the file COPYING for details. } }); }, - + /* * Update the categories div in ajax */ @@ -392,12 +392,12 @@ See the file COPYING for details. if (settings.display_feature == feature.pk){ _popup(feature); methods.display_feature_detail(feature.pk); - settings.map.setCenter(feature.lonlat, 17); - updateCategories(); + settings.map.setCenter(feature.lonlat, 16); + methods.loadCategories(); } return feature; }, - + /* * Put a route on the map */ diff --git a/chimere/templates/chimere/blocks/map_params.html b/chimere/templates/chimere/blocks/map_params.html index 3572ee6..bf1f3c1 100644 --- a/chimere/templates/chimere/blocks/map_params.html +++ b/chimere/templates/chimere/blocks/map_params.html @@ -16,8 +16,10 @@ chimere_init_options["dynamic_categories"] = {{ dynamic_categories }}; {% if p_display_submited %}chimere_init_options["display_submited"] = {{ p_display_submited }};{% endif %} chimere_init_options["checked_categories"] = {{ p_checked_categories }}; - var p_current_feature{% if p_current_feature %} = {{ p_current_feature }}{% endif %}; {% if area_id %}chimere_init_options['area_id'] = "{{area_id}}";{% endif %} + {% if p_current_feature %} + chimere_init_options["display_feature"] = {{ p_current_feature }}; + {% endif %} $("#map").chimere(chimere_init_options); {% if zoom %} $('#maps').chimere('zoom', {'area':{{zoom}} }); diff --git a/chimere/templatetags/chimere_tags.py b/chimere/templatetags/chimere_tags.py index bbd64b4..7f22245 100644 --- a/chimere/templatetags/chimere_tags.py +++ b/chimere/templatetags/chimere_tags.py @@ -109,7 +109,7 @@ def map_params(context): context_data['icon_height'] = settings.CHIMERE_ICON_HEIGHT area_name = context['area_name'] if 'area_name' in context else 'area_name' context_data['map_layers'] = ", ".join(get_map_layers(area_name)) - context_data['p_checked_categories'] = [] + context_data['p_checked_categories'] = "[]" if area_name: try: area = Area.objects.get(urn=area_name) @@ -120,8 +120,8 @@ def map_params(context): unicode(area.upper_left_corner.y), unicode(area.lower_right_corner.x), unicode(area.lower_right_corner.y))) - context_data['p_checked_categories'] = [subcategory.pk - for subcategory in area.default_subcategories.all()] + context_data['p_checked_categories'] = unicode([subcategory.pk + for subcategory in area.default_subcategories.all()]) except ObjectDoesNotExist: pass if 'request' not in context: @@ -138,7 +138,7 @@ def map_params(context): if 'checked_categories' in request.GET \ and request.GET['checked_categories']: cats = request.GET['checked_categories'].split('_') - context_data['p_checked_categories'] = ",".join(cats) + context_data['p_checked_categories'] = "[%s]" % ",".join(cats) return context_data @register.inclusion_tag('chimere/blocks/multimedia_file.html', |