From ff19903cbbdfbc49795c254c6995ff80b9af48c5 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Tue, 17 Nov 2020 14:45:52 +0000 Subject: [PATCH] Let the node name be the map title --- CHANGELOG.md | 1 + README.md | 1 + package.json | 2 +- worldmap.js | 1 + worldmap/index.html | 2 +- worldmap/worldmap.js | 6 ++++++ 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfb69dd..d952b5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### Change Log for Node-RED Worldmap + - v2.5.8 - Let node name be the full page map title - v2.5.7 - Let fillColor set color of hulls - v2.5.6 - Let node accept plain text payload kml or nvg input - v2.5.5 - Fix NVG import to handle symbols for points diff --git a/README.md b/README.md index 053a3d8..b0f6533 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ map web page for plotting "things" on. ### Updates +- v2.5.8 - Let node name be the full page map title - v2.5.7 - Let fillColor set color of hulls - v2.5.6 - Let node accept plain text payload kml or nvg input - v2.5.5 - Fix NVG import to handle symbols for points diff --git a/package.json b/package.json index d0ce00f..2ed1bad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-web-worldmap", - "version": "2.5.7", + "version": "2.5.8", "description": "A Node-RED node to provide a web page of a world map for plotting things on.", "dependencies": { "cgi": "0.3.1", diff --git a/worldmap.js b/worldmap.js index 68f1f60..abdc131 100644 --- a/worldmap.js +++ b/worldmap.js @@ -79,6 +79,7 @@ module.exports = function(RED) { c.grid = {showgrid:node.showgrid}; c.hiderightclick = node.hiderightclick; c.coords = node.coords; + c.toptitle = node.name; client.write(JSON.stringify({command:c})); } }); diff --git a/worldmap/index.html b/worldmap/index.html index a62625f..10550af 100644 --- a/worldmap/index.html +++ b/worldmap/index.html @@ -79,7 +79,7 @@
NRed - Node-RED - map all the things + Node-RED - map all the things
diff --git a/worldmap/worldmap.js b/worldmap/worldmap.js index 0fa398b..04d0234 100644 --- a/worldmap/worldmap.js +++ b/worldmap/worldmap.js @@ -1668,6 +1668,12 @@ function setMarker(data) { // handle any incoming COMMANDS to control the map remotely function doCommand(cmd) { //console.log("COMMAND",cmd); + if (cmd.hasOwnProperty("toptitle")) { + if (!inIframe ) { + document.title = cmd.toptitle; + document.getElementById("topwords").innerText = cmd.toptitle; + } + } if (cmd.hasOwnProperty("clear")) { doTidyUp(cmd.clear); }