From 1a7ccdb45dd8e4de2d92887299ddf986a50dbce3 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 17 May 2023 08:45:05 +0100 Subject: [PATCH] fix hang on layer change --- CHANGELOG.md | 1 + README.md | 1 + package.json | 2 +- worldmap/worldmap.js | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a527d..b248fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### Change Log for Node-RED Worldmap + - v2.37.3 - Fix hang on layer change - v2.37.2 - If custom layer is only layer then show it automatically. Issue #230 - v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229 - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225) diff --git a/README.md b/README.md index 69ab712..31f5686 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ map web page for plotting "things" on. ### Updates +- v2.37.3 - Fix hang on layer change - v2.37.2 - If custom layer is only layer then show it automatically. Issue #230 - v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229 - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225) diff --git a/package.json b/package.json index 7434273..e9abf90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-web-worldmap", - "version": "2.37.2", + "version": "2.37.3", "description": "A Node-RED node to provide a web page of a world map for plotting things on.", "dependencies": { "@turf/bezier-spline": "~6.5.0", diff --git a/worldmap/worldmap.js b/worldmap/worldmap.js index 5c57f7e..9344d2f 100644 --- a/worldmap/worldmap.js +++ b/worldmap/worldmap.js @@ -389,7 +389,7 @@ var edgeAware = function() { var viewBounds = L.latLngBounds(map.options.crs.pointToLatLng(L.point(pSW.x - (pCenter.x - pSW.x ), pSW.y - (pCenter.y - pSW.y )), map.getZoom()) , map.options.crs.pointToLatLng(L.point(pNE.x + (pNE.x - pCenter.x) , pNE.y + (pNE.y - pCenter.y) ), map.getZoom()) ); for (var id in markers) { - if (allData[id].hasOwnProperty("SIDC")) { + if (allData[id] && allData[id].hasOwnProperty("SIDC")) { markerLatLng = markers[id].getLatLng(); if ( viewBounds.contains(markerLatLng) && !mapBounds.contains(markerLatLng) ) { var k = (markerLatLng.lat - mapBoundsCenter.lat) / (markerLatLng.lng - mapBoundsCenter.lng);