Let the node name be the map title

This commit is contained in:
Dave Conway-Jones 2020-11-17 14:45:52 +00:00
parent 795b6ce7b3
commit ff19903cbb
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
6 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap ### 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.7 - Let fillColor set color of hulls
- v2.5.6 - Let node accept plain text payload kml or nvg input - v2.5.6 - Let node accept plain text payload kml or nvg input
- v2.5.5 - Fix NVG import to handle symbols for points - v2.5.5 - Fix NVG import to handle symbols for points

View File

@ -11,6 +11,7 @@ map web page for plotting "things" on.
### Updates ### Updates
- v2.5.8 - Let node name be the full page map title
- v2.5.7 - Let fillColor set color of hulls - v2.5.7 - Let fillColor set color of hulls
- v2.5.6 - Let node accept plain text payload kml or nvg input - v2.5.6 - Let node accept plain text payload kml or nvg input
- v2.5.5 - Fix NVG import to handle symbols for points - v2.5.5 - Fix NVG import to handle symbols for points

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-web-worldmap", "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.", "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": { "dependencies": {
"cgi": "0.3.1", "cgi": "0.3.1",

View File

@ -79,6 +79,7 @@ module.exports = function(RED) {
c.grid = {showgrid:node.showgrid}; c.grid = {showgrid:node.showgrid};
c.hiderightclick = node.hiderightclick; c.hiderightclick = node.hiderightclick;
c.coords = node.coords; c.coords = node.coords;
c.toptitle = node.name;
client.write(JSON.stringify({command:c})); client.write(JSON.stringify({command:c}));
} }
}); });

View File

@ -79,7 +79,7 @@
<body> <body>
<div id="topbar"> <div id="topbar">
<a href="https://nodered.org"><img src="images/node-red.png" width="60" height="24" alt="NRed"/></a> <a href="https://nodered.org"><img src="images/node-red.png" width="60" height="24" alt="NRed"/></a>
<span class="topbar"> Node-RED - map all the things</span> <span class="topbar" id="topwords"> Node-RED - map all the things</span>
</div> </div>
<div id="results"> <div id="results">
<span id="searchRes"></span> <span id="searchRes"></span>

View File

@ -1668,6 +1668,12 @@ function setMarker(data) {
// handle any incoming COMMANDS to control the map remotely // handle any incoming COMMANDS to control the map remotely
function doCommand(cmd) { function doCommand(cmd) {
//console.log("COMMAND",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")) { if (cmd.hasOwnProperty("clear")) {
doTidyUp(cmd.clear); doTidyUp(cmd.clear);
} }