From d20019260e9d245ff8f5c8cd7f3524f4435cac59 Mon Sep 17 00:00:00 2001
From: Dave Conway-Jones
Date: Sat, 16 Feb 2019 17:58:41 +0000
Subject: [PATCH] further readme/info updates
---
README.md | 10 +++++++---
worldmap.html | 8 ++++++--
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index a7b6033..725f7e1 100644
--- a/README.md
+++ b/README.md
@@ -238,9 +238,11 @@ If you select the **drawing** layer you can also add polylines, polygons and rec
The **worldmap in** node can be used to receive various events from the map. Examples of messages coming FROM the map include:
- { "action": "connected" } // useful to trigger delivery or redraw of points
- { "action": "click", ... } // when a marker is clicked
- { "action": "move", ... } // when a marker is moved
+ { "action": "connected" } // useful to trigger delivery or redraw of points
+ { "action": "disconnect", "clients": 1 } // when a client disconnects - reports number remaining
+
+ { "action": "click", "name":"Jason", "layer":"gps", "icon":"male", "iconColor":"blue", "lat":51.024985, "lon":-1.39698 } // when a marker is clicked
+ { "action": "move", "name":"Jason", "layer":"gps", "icon":"male", "iconColor":"blue", "lat":51.044632, "lon":-1.359901 } // when a marker is moved
{ "action": "point", "lat": "50.60634", "lon": "-1.66580", "point": "joe,male,mylayer" }
{ "action": "draw", "type": "rectangle", "points": [ { "lat": 50.61243889044519, "lng": -1.5913009643554688 }, { "lat": 50.66665471366635, "lng": -1.5913009643554688 }, { "lat": 50.66665471366635, "lng": -1.4742279052734375 }, { "lat": 50.61243889044519, "lng": -1.4742279052734375 } ] }
@@ -250,6 +252,8 @@ The **worldmap in** node can be used to receive various events from the map. Exa
{ "action": "addlayer", "name": "myLayer" } // when a new map layer is added
{ "action": "dellayer", "name": "myLayer" } // when a new map layer is deleted
+All actions also include a `msg._sessionid` property that indicates which client session they came from. Any msg sent out that include this will ONLY to that session - so you can target map updates to certain sessions only if required.
+
## Controlling the map
You can also control the map via the node, by sending in a msg.payload containing a **command** object. Multiple parameters can be specified in one command.
diff --git a/worldmap.html b/worldmap.html
index ca5b53f..6ae726a 100644
--- a/worldmap.html
+++ b/worldmap.html
@@ -194,6 +194,7 @@ then by default ⌘⇧m
- ctrl-shift-m
will load the m
Receives actions from a worldmap web page.
Actions include
- connected - when a new client connects
+
- disconnect - when a client disconnects
- click - when a marker is clicked
- move - when a marker is dragged/moved
- point - when a point is added manually using right-click
@@ -203,8 +204,11 @@ then by default ⌘⇧m
- ctrl-shift-m
will load the m
- addlayer - when an overlay is added to the map
- dellayer - when an overlay is removed from the map
- Use the debug node to see the complete payload of the msg returned. Further information
- can be found in the Events section
+ Use the debug node to see the complete payload of the msg returned.
+ All actions also include a msg._sessionid
property that indicates which client session the
+ action came from. Any outgoing msg that includes this property will only go back to that session.
+ Further information can be found in the
+ Events section
of the README.