dceejay / RedMap

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

Line data from live KML? #227

Closed TristanMW closed 1 year ago

TristanMW commented 1 year ago

is it possible to display a live KML which consists of line data onto the map?

dceejay commented 1 year ago

Do you have an example source ? If you can retrieve the data with a Node-RED flow you can probably manipulate it into node-red worldmap format.

TristanMW commented 1 year ago

Here is the link. https://www.google.com/maps/d/kml?mid=1lIaGGeWeTOfAbRSLWZTf7DvV93M&lid=Ym_W3p7SVZ0

We update the line data via google maps often so it would be ideal to make it display on the nodered map aswell

dceejay commented 1 year ago

If you install this zip node - https://flows.nodered.org/node/node-red-contrib-zip you can use this flow to get you started

[{"id":"b1751215cad33518","type":"inject","z":"dbef29b93f753e7e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":120,"wires":[["0500af62808e441b"]]},{"id":"0500af62808e441b","type":"http request","z":"dbef29b93f753e7e","name":"","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://www.google.com/maps/d/kml?mid=1lIaGGeWeTOfAbRSLWZTf7DvV93M&lid=Ym_W3p7SVZ0","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":310,"y":120,"wires":[["27f53981363f52f7"]]},{"id":"27f53981363f52f7","type":"zip","z":"dbef29b93f753e7e","name":"","mode":"decompress","filename":"","compressionlevel":6,"outasstring":true,"x":490,"y":120,"wires":[["71fcaaf476cc5e50"]]},{"id":"71fcaaf476cc5e50","type":"change","z":"dbef29b93f753e7e","name":"","rules":[{"t":"move","p":"payload[0].payload","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":200,"wires":[["cc2b67db0178b1c5"]]},{"id":"cc2b67db0178b1c5","type":"worldmap","z":"dbef29b93f753e7e","name":"","lat":"-29","lon":"30","zoom":"6","layer":"OSMG","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"deg","showgrid":"true","showruler":"false","allowFileDrop":"false","path":"/worldmap","overlist":"DN","maplist":"OSMG,EsriC,EsriS","mapname":"","mapurl":"","mapopt":"","mapwms":false,"x":480,"y":200,"wires":[]}]

You can set the inject to fetch the url as often as you want

image
TristanMW commented 1 year ago

This works perfectly, thank you!