add _sessionid to worldmap in node

This commit is contained in:
Dave Conway-Jones 2018-09-13 07:58:18 -04:00
parent 5bf01197c5
commit fdc92c958e
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
5 changed files with 18 additions and 12 deletions

View File

@ -1,5 +1,7 @@
### Change Log for Node-RED Worldmap
- v1.4.0 - only send to specific _ sessionid if specified.
- v1.3.7 - rescale NATO symbols (less variation, not so small)
- v1.3.6 - setting `msg.payload.draggable = true` will allow a marker to be moved and create a move event on the input node.
- v1.3.5 - parse numeric inputs (speed, bearing etc) to remove any extra text.
- v1.3.4 - Add ISS icon

View File

@ -9,6 +9,7 @@ map web page for plotting "things" on.
### Updates
- v1.4.0 - only send to specific _ sessionid if specified.
- v1.3.7 - rescale NATO symbols (less variation, not so small)
- v1.3.6 - setting `msg.payload.draggable = true` will allow a marker to be moved and create a move event on the input node.
- v1.3.5 - parse numeric inputs (speed, bearing etc) to remove any extra text.
@ -17,12 +18,6 @@ map web page for plotting "things" on.
- v1.3.2 - Bugfix for inline svg icons
- v1.3.1 - Allow `msg.payload.popup = true` to auto open the info popup.
- v1.3.0 - Add initial 3D page (worldmap/index3d.html), Add ability to add KML, GPX and TOPOJSON overlay layers and optional zoom to fit.
- v1.2.4 - Let weblink also specify target page. eg `msg.payload.weblink = {name:"BBC News", url:"news.bbc.co.uk", target:"_new"}`
- v1.2.3 - Add higher maxZoom values for some layers
- v1.2.2 - re-fix simultaneous command plus payload
- v1.2.1 - Sort out map initialisation - especially clusterAt values
- v1.2.0 - Bump version (should have done it for adding velocity layer). Tidy up deletion of marker and tracks.
- v1.1.16 - Add Velocity layer - for velocity grid type overlays (eg wind, currents, etc)
see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list.

View File

@ -1,6 +1,6 @@
{
"name": "node-red-contrib-web-worldmap",
"version": "1.3.8",
"version": "1.4.0",
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": {
"cgi": "0.3.1",

View File

@ -70,9 +70,18 @@ module.exports = function(RED) {
node.status({fill:"green",shape:"dot",text:"connected "+Object.keys(clients).length});
}
node.on('input', function(msg) {
for (var c in clients) {
if (clients.hasOwnProperty(c)) {
clients[c].write(JSON.stringify(msg.payload));
if (msg.hasOwnProperty("_sessionid")) {
if (clients.hasOwnProperty(msg._sessionid)) {
console.log("DING",msg._sessionid);
clients[msg._sessionid].write(JSON.stringify(msg.payload));
}
}
else {
for (var c in clients) {
if (clients.hasOwnProperty(c)) {
console.log("DONG",c);
clients[c].write(JSON.stringify(msg.payload));
}
}
}
});
@ -106,7 +115,7 @@ module.exports = function(RED) {
node.status({fill:"green",shape:"dot",text:"connected "+Object.keys(clients).length});
client.on('data', function(message) {
message = JSON.parse(message);
node.send({payload:message, topic:"worldmap"});
node.send({payload:message, topic:"worldmap", _sessionid:client.id});
});
client.on('close', function() {
delete clients[client.id];

View File

@ -1,5 +1,5 @@
CACHE MANIFEST
# date: Sept 10th 2018 - v1.3.8
# date: Sept 10th 2018 - v1.4.0
CACHE:
index.html