From 3253265b9ea23a342362542a7fbcfb625ce36330 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 29 Sep 2017 16:34:55 +0200 Subject: Fix chimere JS for search --- chimere/static/chimere/js/jquery.chimere.js | 20 ++++++++++++++++++++ chimere/templates/search/search.html | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) 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 '?' %}";