Fix clearing overlays - to close #48

This commit is contained in:
Dave Conway-Jones 2018-10-03 14:57:14 +01:00
parent fb9b44e5be
commit 68953a1747
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
6 changed files with 11 additions and 9 deletions

View File

@ -1,6 +1,7 @@
### Change Log for Node-RED Worldmap ### Change Log for Node-RED Worldmap
- v1.4.4 - Add a couple of extra overlay layers, roads, rail, sea - v1.4.5 - fix clearing overlays
- v1.4.4 - add a couple of extra overlay layers, roads, rail, sea
- v1.4.3 - support custom icon for GPX and KML. Better readme for geojson. - v1.4.3 - support custom icon for GPX and KML. Better readme for geojson.
- v1.4.2 - add NVG layer capability - v1.4.2 - add NVG layer capability
- v1.4.1 - let `msg.payload.popup` set the popup contents. - v1.4.1 - let `msg.payload.popup` set the popup contents.

View File

@ -9,7 +9,8 @@ map web page for plotting "things" on.
### Updates ### Updates
- v1.4.4 - Add a couple of extra overlay layers, roads, rail, sea - v1.4.5 - fix clearing overlays
- v1.4.4 - add a couple of extra overlay layers, roads, rail, sea
- v1.4.3 - support custom icon for GPX and KML. Better readme for geojson. - v1.4.3 - support custom icon for GPX and KML. Better readme for geojson.
- v1.4.2 - add NVG layer capability - v1.4.2 - add NVG layer capability
- v1.4.1 - let `msg.payload.popup` set the popup contents. - v1.4.1 - let `msg.payload.popup` set the popup contents.

View File

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- <!--
Copyright 2015, 2017 IBM Corp. Copyright 2015, 2018 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2015, 2017 IBM Corp. * Copyright 2015, 2018 IBM Corp.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -326,12 +326,12 @@ function doTidyUp(l) {
} }
delete markers[m]; delete markers[m];
} }
if (l) {
layercontrol.removeLayer(layers[l]);
delete overlays[l];
}
} }
} }
if (l) {
if (layers[l]) { map.removeLayer(layers[l]); layercontrol.removeLayer(layers[l]); delete layers[l]; }
if (overlays[l]) { map.removeLayer(overlays[l]); layercontrol.removeLayer(overlays[l]); delete overlays[l]; }
}
} }
// move the daylight / nighttime boundary (if enabled) every minute // move the daylight / nighttime boundary (if enabled) every minute

View File

@ -1,5 +1,5 @@
CACHE MANIFEST CACHE MANIFEST
# date: Oct 1st 2018 - v1.4.5 # date: Oct 2nd 2018 - v1.4.5
CACHE: CACHE:
index.html index.html