From 60f09e834029a8b8d8afea5f308c9027e876cbec Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 18 Nov 2016 11:03:35 +0100 Subject: Map template: cleaning old stuff --- templates/chimere/blocks/map.html | 80 +-------------------------------------- 1 file changed, 1 insertion(+), 79 deletions(-) diff --git a/templates/chimere/blocks/map.html b/templates/chimere/blocks/map.html index 5d6b85e..a51466b 100644 --- a/templates/chimere/blocks/map.html +++ b/templates/chimere/blocks/map.html @@ -96,48 +96,6 @@ $("#{{map_id}}").show(); {% if restricted_extent %}{{ restricted_extent }} chimere_init_options["restricted_extent"] = bounds; {% endif %} - {% comment %} - chimere_init_options["default_icon"] = new OpenLayers.Icon( - '{{STATIC_URL}}saclay/images/default_icon.png', - new OpenLayers.Size(37, 42), - new OpenLayers.Pixel(-(37/2), -42)); - chimere_init_options["icon_start"] = new OpenLayers.Icon( - '{{STATIC_URL}}saclay/images/routing_start.png', - new OpenLayers.Size(37, 42), - new OpenLayers.Pixel(-(37/2), -42)); - chimere_init_options["icon_end"] = new OpenLayers.Icon( - '{{STATIC_URL}}saclay/images/routing_end.png', - new OpenLayers.Size(37, 42), - new OpenLayers.Pixel(-(37/2), -42)); - chimere_init_options["icon_step"] = new OpenLayers.Icon( - '{{STATIC_URL}}saclay/images/routing_step.png', - new OpenLayers.Size(37, 42), - new OpenLayers.Pixel(-(37/2), -42)); - }; - var numZoomLevels = 7; - var maxZoomLevel = 19; - var resolutions; - var zoomOffset; - if (numZoomLevels && maxZoomLevel){ - // variables set to be used in layer definition - var minZoomLevel = maxZoomLevel - numZoomLevels; - resolutions = - OpenLayers.Layer.Bing.prototype.serverResolutions.slice( - maxZoomLevel - numZoomLevels, - maxZoomLevel); - zoomOffset = minZoomLevel; - } - - "icon_offset": new OpenLayers.Pixel({{icon_offset_x}}, - {{icon_offset_y}}), - 'marker_hover_offset': new OpenLayers.Pixel(7, 20), - "popupClass"].imageSrc = "{{STATIC_URL}}/saclay/js/cloud-popup-saclay.png", - "cluster_icon": new OpenLayers.Icon( - STATIC_URL + "saclay/images/cluster_icon.png", - new OpenLayers.Size(39, 46), - new OpenLayers.Pixel(-(39/2), -(46/2))), - //"display_feature_detail_fx": display_feature_detail, - {% endcomment %} $("#{{map_id}}").chimere(chimere_init_options); {% if zoom %} @@ -145,7 +103,7 @@ $("#{{map_id}}").show(); {% endif %} {% for overlay in json_overlays %} - $('#main-map').chimere('addJSON', '{{overlay.overlay_file.url}}', + $('#{{map_id}}').chimere('addJSON', '{{overlay.overlay_file.url}}', "{{overlay.name}}"{% if overlay.style %}, "EPSG:4326", {{overlay.style|safe}}{% endif %}); @@ -156,42 +114,6 @@ $("#{{map_id}}").show(); $('#{{map_id}}').chimere('update_permalink'); }; - // init layer selection - {% comment %} - $(function() { - {% for layer_name, js, def in map_layers %} - $('#layer_list').append("
  • ");{% endfor %} - {% for subcat in subcat_layer %} - {% if not subcat.category %} - $('#layer_list').append("
  • {{subcat.name}}
  • ");{% else %} - $('#layer_list').append("
  • ");{%endif%}{% endfor %} - $('#layer_selection h4').click(function(){ - $('#layer_list').toggle(); - if ($('#layer_list').is(':visible')){ - $('#layer_selection h4').addClass('opened'); - } else { - $('#layer_selection h4').removeClass('opened'); - } - }); - $('#layer_list input[name=layer_type]').change(function(){ - $('#{{map_id}}').chimere('changeMapLayer', $(this).val()); - $('li.layer_map').removeClass('selected'); - $(this).parent().addClass('selected'); - }); - $('#layer_list input[name=layer_cat]').change(function(){ - // the prop has to be called twice not to mess up with the triggered - // click - $('#'+$(this).val()).prop("checked", this.checked); - $('#'+$(this).val()).trigger('click'); - $('#'+$(this).val()).prop("checked", this.checked); - if (this.checked){ - $(this).parent().addClass('selected'); - } else { - $(this).parent().removeClass('selected'); - } - }); - }); - {% endcomment %}