From cb2d1c90d7cf47af91bdbb841cc137125e64b23e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 26 Sep 2018 17:39:45 +0200 Subject: Display a message when no category are displayed (refs #4121) --- chimere/static/chimere/js/jquery.chimere.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js index 028f5c2..64f18e0 100644 --- a/chimere/static/chimere/js/jquery.chimere.js +++ b/chimere/static/chimere/js/jquery.chimere.js @@ -18,6 +18,8 @@ See the file COPYING for details. var extra_url; +var no_marker_message = "There is no element in this category of information yet! Feel free to contribute."; + var labels = { 'routing_from': "From", 'routing_to': "To", @@ -25,7 +27,8 @@ var labels = { 'routing_clean': "Delete the route", 'center_map': "Center map here", 'zoom_in': "Zoom in", - 'zoom_out': "Zoom out" + 'zoom_out': "Zoom out", + 'no_marker_message': "There is no element in this category of information yet! Feel free to contribute." }; if (typeof language != 'undefined'){ @@ -37,7 +40,8 @@ if (typeof language != 'undefined'){ 'routing_clean': "Effacer l'itinéraire", 'center_map': "Centrer la carte ici", 'zoom_in': "Zoom avant", - 'zoom_out': "Zoom arrière" + 'zoom_out': "Zoom arrière", + 'no_marker_message': "Il n'y a pas encore d'élément dans cette catégorie d'information ! N'hésitez pas à contribuer." }; } @@ -1681,7 +1685,10 @@ function transformCoordToLonLat(coord) { if (settings[map_id].enable_clustering){ methods.reinitClustering(map_id); } - if (!data.features) data.features = []; + if (!data.features){ + data.features = []; + if (ids != '0') methods.displayMessage(labels['no_marker_message']); + } if (data.zoom_need_reload){ settings[map_id]._zoom_need_reload = data.zoom_need_reload; } -- cgit v1.2.3