node-red-contrib-jwht-map/examples/Earthquake.json
2016-06-15 12:57:31 +01:00

2 lines
1.9 KiB
JSON

[{"id":"44fb9955.b8db38","type":"function","z":"ff08c5aa.63eb38","name":"remap property names","func":"msg.payload.lat = msg.payload.latitude;\nmsg.payload.lon = msg.payload.longitude;\nmsg.payload.layer = msg.payload.type;\nmsg.payload.icon = msg.payload.type;\nmsg.payload.name = msg.payload.id;\n\ndelete msg.payload.latitude;\ndelete msg.payload.longitude;\ndelete msg.payload.type;\nreturn msg;","outputs":1,"noerr":0,"x":460,"y":780,"wires":[["e02ba15d.2be32","7f4939b8.4cf668"]]},{"id":"e02ba15d.2be32","type":"debug","z":"ff08c5aa.63eb38","name":"","active":true,"console":"false","complete":"payload","x":690,"y":720,"wires":[]},{"id":"1ed29706.066b09","type":"csv","z":"ff08c5aa.63eb38","name":"","sep":",","hdrin":true,"hdrout":"","multi":"one","ret":"\\n","temp":"","x":450,"y":700,"wires":[["44fb9955.b8db38"]]},{"id":"b5c3e32a.597f4","type":"http request","z":"ff08c5aa.63eb38","name":"","method":"GET","url":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.csv","x":290,"y":700,"wires":[["1ed29706.066b09"]]},{"id":"4dc38fda.9d0a4","type":"inject","z":"ff08c5aa.63eb38","name":"quakes","topic":"","payload":"","payloadType":"str","repeat":"600","crontab":"","once":true,"x":130,"y":700,"wires":[["b5c3e32a.597f4"]]},{"id":"6cbdaa62.aeb6c4","type":"comment","z":"ff08c5aa.63eb38","name":"Earthquake !!!","info":"Press the button on the `inject` node to get the list of earthquakes from the USGS public API.\n\nThis returns a CSV - which we then parse using the `CSV` node into individual objects.\n\nThese are then passed through a `function` to remap the property names into ones \nsuitable for the map node, and passed to the `web-socket` out node.\n\nThe map will be served at http://localhost:1880/worldmap .\nYou will need to zoom out :-)","x":130,"y":640,"wires":[]},{"id":"7f4939b8.4cf668","type":"worldmap","z":"ff08c5aa.63eb38","lat":"20","lon":"0","zoom":"2","name":"","x":690,"y":780,"wires":[]}]