dceejay / RedMap

A web map app for Node-RED to put blobs on
Apache License 2.0
107 stars 60 forks source link

Inconsistency in feedback function #270

Closed zafrirron closed 4 weeks ago

zafrirron commented 1 month ago

Feedback function should return object containing

  1. The map entity name
  2. the action from action parameter
  3. The value from the value parameter

There is difference in the feedback behavior between geometry entities and markers, return values. the reason: lines (872 & 884 - version 4.6.5) for markers: 872 - if (v !== undefined) { allData[n][a||"value"] = v; }

here the value is returned under key 'action'. as a result, the receiving nodes should parse the value according to the 'action' key (instead of accessing the value key and only routing by the action key).

for other entities: 884- ws.send(JSON.stringify({action:a||"feedback", name:n, value:v, lat:rclk.lat, lon:rclk.lng}));

values returned under 'value' key...

the correction should be in line 872, change to: if (v !== undefined) { allData[n]["value"] = v; }