dceejay / RedMap

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

Converting shapes for geofence #253

Closed eightbit88 closed 6 months ago

eightbit88 commented 6 months ago

Firstly, I would like to thank you for the outstanding job on this add-on it is simply great work!

Is there a possibility to convert a shape drawn with the drawing tools to a geofence? The geofence node is a great tool however the interface is not within the map and rather requires the use inside the node-red programming environment. Which makes it not possible for general users to create the fence. I know, half of the answer is with the maker of the geofence node.

Regards

dceejay commented 6 months ago

actually all the answer is in the geofence node - as the map can output the shape ok...

If you look at the source of the geofence node https://github.com/hardillb/node-red-node-geofence/blob/19767def71764707a0f7a5a274ce330651034312/geofence.js#L70 There are some commented out line that seem to do what you want - I.E. - if the incoming message is a draw command and the object being drawn is the same name as the geofence then to replace the shape with the incoming shape. I haven't tried it - so no idea if it is correct, but should get you most of the way.