fix removelayer syntax to close #116

pushed as version 2.1.2
This commit is contained in:
Dave Conway-Jones 2019-09-18 15:38:03 +01:00
parent cf88fffb48
commit f061ac10c1
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
4 changed files with 420 additions and 421 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap
- v2.1.2 - Fix layercontrol remove bug. Issue #116
- v2.1.1 - fix bug in repeated add with polygon
- v2.1.0 - add ui-worldmap node to make embedding in Dashboard easier. Let -in node specify connection actions only.
- v2.0.22 - fix SIDC missing property

View File

@ -7,6 +7,7 @@ map web page for plotting "things" on.
### Updates
- v2.1.2 - Fix layercontrol remove bug. Issue #116
- v2.1.1 - fix bug in repeated add with polygon
- v2.1.0 - add ui-worldmap node to make embedding in Dashboard easier. Let -in node specify connection actions only.
- v2.0.22 - fix SIDC missing property

View File

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

View File

@ -1466,8 +1466,6 @@ function setMarker(data) {
markers[data.name] = marker;
layers[lay].addLayer(marker);
if ((data.hdg != null) && (data.bearing == null)) { data.bearing = data.hdg; delete data.hdg; }
if (data.bearing != null) { // if there is a heading
if (data.speed != null) { data.length = parseFloat(data.speed || "0") * 50; } // and a speed
@ -1507,7 +1505,6 @@ function setMarker(data) {
}
if (panit) { map.setView(ll,map.getZoom()); }
if (p === true) { marker.openPopup(); }
}
// handle any incoming COMMANDS to control the map remotely
@ -1545,7 +1542,7 @@ function doCommand(cmd) {
if (cmd.hasOwnProperty("showlayers")) {
if ((cmd.showlayers === "hide") && (showLayerMenu === true)) {
showLayerMenu = false;
if (layercontrol) { layercontrol.removeFrom(map); }
if (layercontrol) { map.removeControl(layercontrol); }
}
else if ((cmd.showlayers === "show") && (showLayerMenu === false)) {
showLayerMenu = true;