diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-11-18 11:03:35 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-11-18 11:03:35 +0100 |
commit | 60f09e834029a8b8d8afea5f308c9027e876cbec (patch) | |
tree | d0e1c11a7b3446f9de07dbf5e72097348f71c80e | |
parent | 0e08ed378ee059f2ad4ddd5c54f501ef2c2ad649 (diff) | |
download | Chimère - projet Saclay-60f09e834029a8b8d8afea5f308c9027e876cbec.tar.bz2 Chimère - projet Saclay-60f09e834029a8b8d8afea5f308c9027e876cbec.zip |
Map template: cleaning old stuff
-rw-r--r-- | templates/chimere/blocks/map.html | 80 |
1 files changed, 1 insertions, 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("<li class='layer_map{% if def %} selected{%endif%}'><input type='radio' value='{{forloop.counter0}}' name='layer_type' id='layer_{{forloop.counter}}'{% if def %} checked='checked'{% endif %}><label for='layer_{{forloop.counter}}'>{{layer_name}}</li>");{% endfor %} - {% for subcat in subcat_layer %} - {% if not subcat.category %} - $('#layer_list').append("<li class='head layer_category'>{{subcat.name}}</li>");{% else %} - $('#layer_list').append("<li class='layer_subcat{% if subcat.pk in checked_categories %} selected{%endif%}'><input type='checkbox' name='layer_cat' value='category_{{subcat.pk}}' id='layer_cat_{{subcat.pk}}'{% if subcat.pk in checked_categories %} checked='checked'{% endif %}><label for='layer_cat_{{subcat.pk}}'>{{subcat.name}}</li>");{%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 %} </script> <div id='marker_hover'><div id='marker_hover_content'></div></div> <div class="modal fade" id="cluster_list" tabindex="-1" role="dialog" aria-labelledby="cluster-label" aria-hidden="true"> |