Stop delete marker feedback

to close #59
This commit is contained in:
Dave Conway-Jones 2018-12-07 11:27:21 +00:00
parent 7ce853145a
commit 0194165a8a
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
4 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap ### Change Log for Node-RED Worldmap
- v1.5.14 - Stop delete marker feedback to allow updating multiple maps - Issue #59
- v1.5.13 - Send click message to websocket on marker click - Issue #56, #57 - v1.5.13 - Send click message to websocket on marker click - Issue #56, #57
- v1.5.11 - Let search also try geocoding lookup if not found in marks. - v1.5.11 - Let search also try geocoding lookup if not found in marks.
- v1.5.10 - Allow latest mark added to open popup, and allow `popped=false` to close. - v1.5.10 - Allow latest mark added to open popup, and allow `popped=false` to close.

View File

@ -9,6 +9,7 @@ map web page for plotting "things" on.
### Updates ### Updates
- v1.5.14 - Stop delete marker feedback to allow updating multiple maps - Issue #59
- v1.5.13 - Send click message to websocket on marker click - Issue #56, #57 - v1.5.13 - Send click message to websocket on marker click - Issue #56, #57
- v1.5.11 - Let search also try geocoding lookup if not found in marks. - v1.5.11 - Let search also try geocoding lookup if not found in marks.
- v1.5.10 - Allow latest mark added to open popup, and allow `popped=false` to close. - v1.5.10 - Allow latest mark added to open popup, and allow `popped=false` to close.

View File

@ -592,7 +592,7 @@ map.on('zoomend', function() {
//}); //});
// single right click to add a marker // single right click to add a marker
var rightmenuMap = L.popup({keepInView:true, minWidth:250}).setContent("<b>Add marker</b><br><input type='text' id='rinput' onkeydown='if (event.keyCode == 13) addThing();' placeholder='name (,icon, layer, colour)'/>"); var rightmenuMap = L.popup({keepInView:true, minWidth:250}).setContent("<b>Add marker</b><br><input type='text' id='rinput' autofocus onkeydown='if (event.keyCode == 13) addThing();' placeholder='name (,icon, layer, colour)'/>");
var rclk; var rclk;
var addThing = function() { var addThing = function() {
@ -857,7 +857,8 @@ var doDialog = function(d) {
} }
// Delete a marker (and notify websocket) // Delete a marker (and notify websocket)
var delMarker = function(dname) { var delMarker = function(dname,note) {
if (note) { map.closePopup(); }
if (typeof polygons[dname] != "undefined") { if (typeof polygons[dname] != "undefined") {
layers[polygons[dname].lay].removeLayer(polygons[dname]); layers[polygons[dname].lay].removeLayer(polygons[dname]);
delete polygons[dname]; delete polygons[dname];
@ -872,7 +873,7 @@ var delMarker = function(dname) {
delete markers[dname]; delete markers[dname];
} }
delete allData[dname]; delete allData[dname];
ws.send(JSON.stringify({action:"delete", name:dname})); if (note) { ws.send(JSON.stringify({action:"delete", name:dname, deleted:true})); }
//map.closePopup(); //map.closePopup();
} }
@ -1267,7 +1268,7 @@ function setMarker(data) {
marker.bindPopup(words + marker.getLatLng().toString().replace('LatLng(','lat, lon : ').replace(')',''), {keepInView:true, minWidth:250}); marker.bindPopup(words + marker.getLatLng().toString().replace('LatLng(','lat, lon : ').replace(')',''), {keepInView:true, minWidth:250});
marker._popup.dname = data.name; marker._popup.dname = data.name;
marker.lay = lay; // and the layer it is on marker.lay = lay; // and the layer it is on
var rightmenuMarker = L.popup().setContent("<b>"+data.name+"</b><br/><button id='delbutton' onclick='delMarker(\""+data.name+"\");'>Delete</button>"); var rightmenuMarker = L.popup().setContent("<b>"+data.name+"</b><br/><button id='delbutton' onclick='delMarker(\""+data.name+"\",true);'>Delete</button>");
marker.on('contextmenu', function(e) { marker.on('contextmenu', function(e) {
rightmenuMarker.setLatLng(e.latlng); rightmenuMarker.setLatLng(e.latlng);
map.openPopup(rightmenuMarker); map.openPopup(rightmenuMarker);

View File

@ -1,5 +1,5 @@
CACHE MANIFEST CACHE MANIFEST
# date: Nov 9th 2018 - v1.5.13 # date: Dec 7th 2018 - v1.5.14
CACHE: CACHE:
index.html index.html