Show ruler if grib turned on, better fix for array of tracks

to close #127, to close #124
This commit is contained in:
Dave Conway-Jones 2020-04-14 13:46:45 +01:00
parent e405c73510
commit 8f51fa21ae
No known key found for this signature in database
GPG Key ID: 302A6725C594817F
5 changed files with 14 additions and 9 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap ### Change Log for Node-RED Worldmap
- v2.3.6 - show ruler if grid is turned on.
- v2.3.5 - Let tracks node handle array of points. Let http icons be rotated to hdg or bearing. - v2.3.5 - Let tracks node handle array of points. Let http icons be rotated to hdg or bearing.
- v2.3.4 - Add bus icon - v2.3.4 - Add bus icon
- v2.3.3 - Fix satellite view max zoom - v2.3.3 - Fix satellite view max zoom

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-web-worldmap", "name": "node-red-contrib-web-worldmap",
"version": "2.3.5", "version": "2.3.6",
"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

@ -407,9 +407,6 @@ then by default <code>⌘⇧m</code> - <code>ctrl-shift-m</code> will load the m
labelStyle: function() { labelStyle: function() {
return this.name?"node_label_italic":""; return this.name?"node_label_italic":"";
}, },
info: function() {
return 'The map can be found [here]('+RED.settings.httpNodeRoot.slice(0,-1)+this.path+').';
},
oneditprepare: function() { oneditprepare: function() {
$("#node-input-size").elementSizer({ $("#node-input-size").elementSizer({
width: "#node-input-width", width: "#node-input-width",

View File

@ -55,6 +55,7 @@ module.exports = function(RED) {
var clients = {}; var clients = {};
RED.httpNode.use(compression()); RED.httpNode.use(compression());
RED.httpNode.use(node.path, express.static(__dirname + '/worldmap')); RED.httpNode.use(node.path, express.static(__dirname + '/worldmap'));
// RED.httpNode.use(node.path, express.static(__dirname + '/worldmap', {maxage:3600000}));
var callback = function(client) { var callback = function(client) {
//client.setMaxListeners(0); //client.setMaxListeners(0);
@ -346,10 +347,16 @@ module.exports = function(RED) {
} }
node.on("input", function(m) { node.on("input", function(m) {
if (Array.isArray(m)) { if (Array.isArray(m.payload)) {
m.forEach(item => doTrack(item)); m.payload.forEach(function (pay) {
var n = RED.util.cloneMessage(m)
n.payload = pay;
doTrack(n);
});
}
else {
doTrack(m);
} }
else { doTrack(m); }
}); });
node.on("close", function() { node.on("close", function() {

View File

@ -1651,8 +1651,8 @@ function doCommand(cmd) {
if ((cmd.grid.showgrid == "false" || cmd.grid.showgrid == false ) && showGrid) { changed = true; } if ((cmd.grid.showgrid == "false" || cmd.grid.showgrid == false ) && showGrid) { changed = true; }
if (changed) { if (changed) {
showGrid = !showGrid; showGrid = !showGrid;
if (showGrid) { Lgrid.addTo(map); } if (showGrid) { Lgrid.addTo(map); rulerButton.addTo(map); }
else { Lgrid.removeFrom(map); } else { Lgrid.removeFrom(map); rulerButton.removeFrom(map); }
} }
} }
if (cmd.grid.hasOwnProperty("opt")) { if (cmd.grid.hasOwnProperty("opt")) {