From b4b15bb5656e81a105b7f1ce451a44bb8ba8215e Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Mon, 30 Oct 2017 09:29:18 +0100 Subject: [PATCH] Fixed a bug trying to delete a not existing marker (geo) + Fixed leaflet dependencies to use local script instead of remote --- static/js/geo.js | 3 ++- templates/geo.html | 43 ++++++++++++++++++++----------------------- templates/index.html | 27 ++++++++++++--------------- 3 files changed, 34 insertions(+), 39 deletions(-) diff --git a/static/js/geo.js b/static/js/geo.js index bffb5d2..d2160a2 100644 --- a/static/js/geo.js +++ b/static/js/geo.js @@ -112,7 +112,8 @@ $(document).ready(function () { function updateTopMaps(date) { $.getJSON(urlTopCoord+"?date="+date.getTime()/1000, function(list){ - if (list.length==0) { + if (list.length==0 && savedMarker[1]!=undefined) { //No data and new markers + console.log(savedMarker.length); for(var i=0; i<6; i++) { // clear maps allOpenStreetMap[i+1].setView([0, 0], 1); savedMarker[i+1].remove(); // remove marker diff --git a/templates/geo.html b/templates/geo.html index 9b30b0f..50302b2 100644 --- a/templates/geo.html +++ b/templates/geo.html @@ -14,13 +14,26 @@ - - - + + + + + + + + + + + + + + + + + + + + @@ -211,22 +224,6 @@ small { - - - - - - - - - - - - - - - - + + + + + + + + + + + + @@ -230,14 +235,6 @@ small { - - - - - - - -