add lat lon to feedback function

This commit is contained in:
Dave Conway-Jones 2020-08-24 11:39:59 +01:00
parent d94544d998
commit 139f901928
No known key found for this signature in database
GPG Key ID: 302A6725C594817F
5 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap
- v2.5.1 - Add lat, lng and layer to feedback function.
- v2.5.0 - Add minimap capability.
- v2.4.2 - Fix editing injected shapes.
- v2.4.1 - Add convex-hull node for grouping objects.

View File

@ -11,6 +11,8 @@ map web page for plotting "things" on.
### Updates
- v2.5.1 - Add lat, lng and layer to feedback function.
- v2.5.0 - Add minimap capability.
- v2.4.2 - Fix editing injected shapes.
- v2.4.1 - Add convex-hull node for grouping objects.
- v2.3.16 - Add heading to default addMarker, allow custom http icon size.
@ -342,7 +344,7 @@ The **worldmap in** node can be used to receive various events from the map. Exa
{ "action": "button", "name": "My Fancy Button" } // when a user defined button is clicked
{ "action": "feedback", "name": "some name", "value": "some value" } // when a user calls the feedback function - see below
{ "action": "feedback", "name": "some name", "value": "some value", "lat":51, "lon":0, "layer":"unknown" } // when a user calls the feedback function - see below
All actions also include a `msg._sessionid` property that indicates which client session they came from. Any msg sent out that includes this property will ONLY be sent to that session - so you can target map updates to specific sessions if required.

View File

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

@ -196,7 +196,7 @@ module.exports = function(RED) {
if (done) { done(); }
});
}
RED.nodes.registerType("ui_worldmap", UIWorldMap);
setImmediate(function() { RED.nodes.registerType("ui_worldmap", UIWorldMap) });
}
}
catch(e) {

View File

@ -577,7 +577,8 @@ var addThing = function() {
}
var feedback = function(n,v,a) {
ws.send(JSON.stringify({action:a||"feedback", name:n, value:v}));
var fp = markers[n]._latlng;
ws.send(JSON.stringify({action:a||"feedback", name:n, layer:markers[n].lay, lat:fp.lat, lon:fp.lng, value:v}));
}
// allow double right click to zoom out (if enabled)