diff --git a/templates/geo.html b/templates/geo.html index d22f344..c4f05e6 100644 --- a/templates/geo.html +++ b/templates/geo.html @@ -328,20 +328,22 @@ small { var coord = circleRadius._latlng; var dateStart = datePickersRadiusWidgetFrom.datepicker("getDate").getTime() / 1000; var dateEnd = datePickersRadiusWidgetTo.datepicker("getDate").getTime() / 1000; - $.getJSON("{{ url_for('getCoordsByRadius') }}?dateStart="+dateStart+"&dateEnd="+dateEnd+"¢erLat="+coord.lat+"¢erLon="+coord.lng+"&radius="+radius_km, function(list){ + $.getJSON("{{ url_for('getCoordsByRadius') }}?dateStart="+dateStart+"&dateEnd="+dateEnd+"¢erLat="+coord.lat+"¢erLon="+coord.lng+"&radius="+radius_km, function(allList){ // remove old markers for (var i in savedMarkerRadius) { savedMarkerRadius[i].remove(); // remove marker } - var list = list[0]; - for (var dayListIndex in list) { - var jsonData = list[dayListIndex][0]; - var coordJson = list[dayListIndex][1]; + for (var listIndex in allList) { + var list = allList[listIndex]; + for (var dayListIndex in list) { + var jsonData = list[dayListIndex][0]; + var coordJson = list[dayListIndex][1]; - var marker = L.marker([coordJson[1], coordJson[0]]).addTo(radiusOpenStreetMap); - savedMarkerRadius.push(marker); - marker.bindPopup(''+jsonData.categ+'
'+jsonData.value, {autoClose:false}).openPopup(); + var marker = L.marker([coordJson[1], coordJson[0]]).addTo(radiusOpenStreetMap); + savedMarkerRadius.push(marker); + marker.bindPopup(''+jsonData.categ+'
'+jsonData.value, {autoClose:false}).openPopup(); + } } }); } @@ -383,7 +385,6 @@ small { buttonImageOnly: true, buttonText: "Select date", showAnim: "slideDown", - onSelect: updateRadius }; datePickerWidget = $( "#datepicker" )