Skip to content

Commit

Permalink
fix missing countries overlay when starting disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
dceejay committed Aug 12, 2023
1 parent 9421860 commit 17b83b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap

- v2.40.1 - Fix missing countries overlay when starting disconnected.
- v2.40.0 - Add handling for TAK event points from TAK ingest node.
- v2.39.0 - Add client timezone to connect message. PR #245
- v2.38.3 - Better fix for geojson multipoint icons.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%

### Updates

- v2.40.1 - Fix missing countries overlay when starting disconnected.
- v2.40.0 - Add handling for TAK event points from TAK ingest node.
- v2.39.0 - Add client timezone to connect message. PR #245
- v2.38.3 - Better fix for geojson multipoint icons.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-web-worldmap",
"version": "2.40.0",
"version": "2.40.1",
"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",
Expand Down
9 changes: 7 additions & 2 deletions worldmap/worldmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,13 @@ var handleData = function(data) {

window.onunload = function() { if (ws) ws.close(); }

var onoffline = function() { if (!navigator.onLine) { map.addLayer(layers["_countries"]); } }
var customTopoLayer = L.geoJson(null, {clickable:false, style: {color:"blue", weight:2, fillColor:"#cf6", fillOpacity:0.04}});
layers["_countries"] = omnivore.topojson('images/world-50m-flat.json',null,customTopoLayer);
overlays["countries"] = layers["_countries"];

var onoffline = function() { if (!navigator.onLine) {
map.addLayer(overlays["countries"]);
} }

document.addEventListener ("keydown", function (ev) {
// Set Ctl-Alt-3 to switch to 3d view
Expand Down Expand Up @@ -1216,7 +1222,6 @@ var addOverlays = function(overlist) {
sendDrawing(n);
});
}

}

// Add the countries (world-110m) for offline use
Expand Down

0 comments on commit 17b83b1

Please sign in to comment.