fix polygon to always have delete option... (maybe)

This commit is contained in:
Dave Conway-Jones 2021-10-02 13:24:52 +01:00
parent 64db718fea
commit 704b6edcb6
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
4 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap ### Change Log for Node-RED Worldmap
- v2.16.3 - Ensure polygons can be deleted.
- v2.16.2 - better handling of unpacked gpz objects. - v2.16.2 - better handling of unpacked gpz objects.
- v2.16.0 - Allow specifying custom base map server. - v2.16.0 - Allow specifying custom base map server.
- v2.15.8 - Adjust ui check timing for UI worldmap. - v2.15.8 - Adjust ui check timing for UI worldmap.

View File

@ -11,6 +11,7 @@ map web page for plotting "things" on.
### Updates ### Updates
- v2.16.3 - Ensure polygons can be deleted.
- v2.16.2 - better handling of unpacked gpz objects. - v2.16.2 - better handling of unpacked gpz objects.
- v2.16.0 - Allow specifying custom base map server. - v2.16.0 - Allow specifying custom base map server.
- v2.15.8 - Adjust ui check timing for UI worldmap. - v2.15.8 - Adjust ui check timing for UI worldmap.

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-web-worldmap", "name": "node-red-contrib-web-worldmap",
"version": "2.16.2", "version": "2.16.3",
"description": "A Node-RED node to provide a web page of a world map for plotting things on.", "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": { "dependencies": {
"cgi": "0.3.1", "cgi": "0.3.1",

View File

@ -428,8 +428,6 @@ function setMaxAge() {
if (stale) { clearInterval(stale); } if (stale) { clearInterval(stale); }
//if (maxage > 0) { //if (maxage > 0) {
stale = setInterval( function() { doTidyUp() }, 20000); // check every 20 secs stale = setInterval( function() { doTidyUp() }, 20000); // check every 20 secs
//} //every minute
//console.log("Stale time set :",maxage+"s");
} }
setMaxAge(); setMaxAge();
@ -1233,12 +1231,13 @@ var rangerings = function(latlng, options) {
// the MAIN add something to map function // the MAIN add something to map function
function setMarker(data) { function setMarker(data) {
var rightmenu = function(m) { var rightmenu = function(m) {
// customise right click context menu // customise right click context menu
var rightcontext = ""; var rightcontext = "";
if (polygons[data.name] == undefined) { //if (polygons[data.name] == undefined) {
rightcontext = "<button id='delbutton' onclick='delMarker(\""+data.name+"\",true);'>Delete</button>"; rightcontext = "<button id='delbutton' onclick='delMarker(\""+data.name+"\",true);'>Delete</button>";
} //}
if (data.editable) { if (data.editable) {
rightcontext = "<button onclick='editPoly(\""+data.name+"\",true);'>Edit</button><button onclick='delMarker(\""+data.name+"\",true);'>Delete</button>"; rightcontext = "<button onclick='editPoly(\""+data.name+"\",true);'>Edit</button><button onclick='delMarker(\""+data.name+"\",true);'>Delete</button>";
} }