diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-09-29 16:34:55 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-09-29 16:34:55 +0200 |
commit | 3253265b9ea23a342362542a7fbcfb625ce36330 (patch) | |
tree | da78b13979e992504367e379513d3e3498f136ac /chimere | |
parent | 42c688f5c7817d1e69c6ee4c1cb59d90ffbb7885 (diff) | |
download | Chimère-3253265b9ea23a342362542a7fbcfb625ce36330.tar.bz2 Chimère-3253265b9ea23a342362542a7fbcfb625ce36330.zip |
Fix chimere JS for search
Diffstat (limited to 'chimere')
-rw-r--r-- | chimere/static/chimere/js/jquery.chimere.js | 20 | ||||
-rw-r--r-- | chimere/templates/search/search.html | 5 |
2 files changed, 24 insertions, 1 deletions
diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js index 026027d..3f99237 100644 --- a/chimere/static/chimere/js/jquery.chimere.js +++ b/chimere/static/chimere/js/jquery.chimere.js @@ -1383,6 +1383,11 @@ function transformCoordToLonLat(coord) { }, activateContextMenu: function(){ + var map_id = methods.map_id(this); + if (!map_id){ + alert("activateContextMenu - Public method only"); + return; + } settings[map_id].edition_type_is_route = false; // settings[map_id].map.events.unregister('click', settings[map_id].map, // methods.setMarker); @@ -2210,6 +2215,11 @@ function transformCoordToLonLat(coord) { //fin lib ios cleanRoute: function(){ + var map_id = methods.map_id(this); + if (!map_id){ + alert("cleanRoute - Public method only"); + return; + } if (typeof settings[map_id].editionSource != 'undefined') settings[map_id].editionSource.clear(); }, @@ -3112,6 +3122,11 @@ function transformCoordToLonLat(coord) { */ }, zoomToMarkerExtent: function(){ + var map_id = methods.map_id(this); + if (!map_id){ + alert("zoomToMarkerExtent - Public method only"); + return; + } methods._set_animation(map_id); options = {}; if ($("#panel").is(":visible")){ @@ -3123,6 +3138,11 @@ function transformCoordToLonLat(coord) { }, // methods for edition cleanMarker: function(){ + var map_id = methods.map_id(this); + if (!map_id){ + alert("cleanMarker - Public method only"); + return; + } if (settings[map_id].current_edit_feature) { settings[map_id].layerDbFeatures.removeMarker(settings[map_id].current_edit_feature); } diff --git a/chimere/templates/search/search.html b/chimere/templates/search/search.html index e2f7619..d01c16e 100644 --- a/chimere/templates/search/search.html +++ b/chimere/templates/search/search.html @@ -9,7 +9,9 @@ var end_do_you_mean = "{% trans '?' %}"; <ul> {% for result in results %} <li> - <img src='{{MEDIA_URL}}{{result.properties.icon_path}}'/><a href="#" onclick="$('#main-map').chimere('showPopup', '{{result.properties.key}}');return false;">{{ result.properties.name }}</a> + <a href="#" onclick="$('#main-map').chimere('showPopup', '{{result.properties.key}}');return false;"> + <img src='{{MEDIA_URL}}{{result.properties.icon_path}}'/>{{ result.properties.name }} + </a> </li> {% empty %} <li>{% trans "No results found." %}</li> @@ -42,6 +44,7 @@ $(function(){ function(evt){ $("#main-map").chimere("razMap"); haystack_search(evt); + search_panel_open(); }); {% if autocomplete %} window.autocomplete = new Autocomplete({ |