summaryrefslogtreecommitdiff
path: root/chimere
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-16 16:59:18 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-16 16:59:18 +0100
commita489cfe6556d26af0e280d533f78c9a378cc4929 (patch)
treecd2c0545202236e2115c5b595d45bcc9f2cfefb3 /chimere
parente6801bc85e7162189f09a23edc7d0ff179f5ed62 (diff)
downloadChimère-a489cfe6556d26af0e280d533f78c9a378cc4929.tar.bz2
Chimère-a489cfe6556d26af0e280d533f78c9a378cc4929.zip
Fix checked categories when a permalink is activated
Diffstat (limited to 'chimere')
-rw-r--r--chimere/templates/chimere/blocks/map.html9
1 files changed, 7 insertions, 2 deletions
diff --git a/chimere/templates/chimere/blocks/map.html b/chimere/templates/chimere/blocks/map.html
index fd0cae4..87d0efc 100644
--- a/chimere/templates/chimere/blocks/map.html
+++ b/chimere/templates/chimere/blocks/map.html
@@ -40,7 +40,6 @@ $("#{{map_id}}").show();
{% if MOBILE %}"mobile": true,{% endif %}
{% if enable_clustering %}"enable_clustering": true,{% endif %}
{% if js_map_layers %}"map_layers": [{{js_map_layers|safe|escape}}],{% endif %}
- {% if dynamic_categories %}'dynamic_categories': true,{% endif %}
{% if default_area %}"default_area": new Array({{default_area.upper_left_corner.x}}, {{default_area.upper_left_corner.y}}, {{default_area.lower_right_corner.x}}, {{default_area.lower_right_corner.y}}),{% endif %}
{% if p_zoom %}"zoom": {{ p_zoom }},{% endif %}
{% if p_lat %}"lat": {{ p_lat }},{% endif %}
@@ -54,7 +53,6 @@ $("#{{map_id}}").show();
{% if p_routing_speed %}"routing_speed": "{{ p_routing_speed }}",{% endif %}
"dynamic_categories": {{ dynamic_categories }},
{% if p_display_submited %}"display_submited": {{ p_display_submited }},{% endif %}
- "checked_categories": [{% for cc in checked_categories %}{% if forloop.counter0 > 0 %}, {% endif %}{{cc}}{% endfor %}],
{% if area_id %}'area_id': "{{area_id}}",{% endif %}
{% if p_current_feature %}
"display_feature": {{ p_current_feature }},{% endif %}
@@ -74,6 +72,13 @@ $("#{{map_id}}").show();
{% if restricted_extent %}{{ restricted_extent }}
chimere_init_options["restricted_extent"] = bounds;
{% endif %}
+ {% if checked_categories %}
+ /* not a permalink */
+ if (window.location.href.indexOf("#") <= -1) {
+ chimere_init_options["checked_categories"] = [
+ {% for cc in checked_categories %}{% if forloop.counter0 > 0 %}, {% endif %}{{cc}}{% endfor %}];
+ }
+ {% endif %}
$('#category_description').modal({show:false});
$("#main-map").chimere(chimere_init_options);