From c7ce07e8d4b9a7b48ebac3b1ceecbea144ca2c41 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Tue, 20 Jun 2017 23:27:18 +0100 Subject: [PATCH] Map tidy up - add msg.latitude to tracks --- package.json | 2 +- worldmap.js | 7 ++++++- worldmap/index.html | 14 ++++++++------ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 05fe7fb..cad50ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-contrib-web-worldmap", - "version" : "1.0.29", + "version" : "1.0.30", "description" : "A Node-RED node to provide a web page of a world map for plotting things on.", "dependencies" : { "express": "^4.15.0", diff --git a/worldmap.js b/worldmap.js index d672b9b..586a099 100644 --- a/worldmap.js +++ b/worldmap.js @@ -105,6 +105,7 @@ module.exports = function(RED) { } RED.nodes.registerType("worldmap in",WorldMapIn); + var satarray = {}; var WorldMapTracks = function(n) { RED.nodes.createNode(this,n); @@ -127,7 +128,6 @@ module.exports = function(RED) { if (satarray[msg.payload.name].length > node.depth) { satarray[msg.payload.name].shift(); } - var line = []; for (var i=0; iPictures
'; } @@ -813,24 +813,26 @@ function setMarker(data) { icon = ''; icon += ''; var svgplane = "data:image/svg+xml;base64," + btoa(icon); + var dir = data.hdg || data.bearing; myMarker = L.divIcon({ className:"planeicon", iconAnchor: [15, 15], - html:'', + html:'', }); marker = L.marker(ll, {title: data.name, icon: myMarker}); - q = 'http://www.bing.com/images/search?q='+data.icon+'%20'+encodeURIComponent(data.name); - words += 'Pictures
'; + //q = 'http://www.bing.com/images/search?q='+data.icon+'%20'+encodeURIComponent(data.name); + //words += 'Pictures
'; } else if (data.icon === "car") { data.iconColor = data.iconColor || "black"; icon = ''; icon += ''; var svgcar = "data:image/svg+xml;base64," + btoa(icon); + var dir = data.hdg || data.bearing; myMarker = L.divIcon({ className:"caricon", iconAnchor: [15, 15], - html:'', + html:'', }); marker = L.marker(ll, {title: data.name, icon: myMarker}); } @@ -918,7 +920,7 @@ function setMarker(data) { delete data.weblink; } for (var i in data) { - if (i != "name") { + if ((i != "name") && (i != "length")) { if (typeof data[i] === "object") { words += i +" : "+JSON.stringify(data[i])+"
"; } else {