node-red-contrib-web-worldmap issues

3,252 views
Skip to first unread message

Peter Scargill

unread,
May 30, 2016, 5:06:12 PM5/30/16
to Node-RED
I've had a couple of goes at getting a response to this one.... has anyone tried this node?  I cannot get anything out of it - that is - it works - I can see a map of the UK down south - but nothing I put into the payload seems to make any difference to what is on the map. I downloaded the latest version yesterday for the first time - and I've come to a halt.

Anyone done better? Am I missing something - there's an example of a name, lon and lat coordinates in braces as the payload  - does nothing for me?

Dave C-J

unread,
May 30, 2016, 5:25:32 PM5/30/16
to node...@googlegroups.com
Peter

the curly braces and the word properties should indicate that it is an object... (and not a string)...  
open the map first... then send a msg
with   msg.payload = {name:"Joe", lat:51, lon:-1.05};

Steampunk Prof

unread,
May 30, 2016, 5:30:08 PM5/30/16
to Node-RED
Hi,

I've had it up and running and tracking my position quite nicely (used so my son could see when we were getting close to his place and get it tidied). It does seem a bit fussy about how the info is passed into it.
This is working for me, obviously you'll need to change your broker details.:
[{"id":"2a2f5d46.eee39a","type":"mqtt-broker","z":"","broker":"192.168.0.100","port":"1883","clientid":"Device-S1","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"43200","cleansession":true,"willTopic":"","willQos":"0","willRetain":null,"willPayload":"","birthTopic":"","birthQos":"0","birthRetain":null,"birthPayload":""},{"id":"8514277e.8776a","type":"worldmap","z":"743a166.a8974e8","name":"Where am I? ","x":390,"y":80,"wires":[]},{"id":"e9b2cb61.410ac","type":"mqtt in","z":"743a166.a8974e8","name":"Shrike","topic":"owntracks/pi/Shrike","broker":"2a2f5d46.eee39a","x":67,"y":82,"wires":[["6ab90cdb.45f7c4"]]},{"id":"6ab90cdb.45f7c4","type":"function","z":"743a166.a8974e8","name":"MQTT to JSON","func":"msg.payload = JSON.parse(msg.payload);\nvar f_lat = msg.payload.lat;\nvar f_lon = msg.payload.lon;\nvar thing = {\n    layer:\"OSM\",\n    name:\"Me\", \n    lat:f_lat, \n    lon:f_lon,\n    icon:\"car\",\n    iconColor:\"red\",\n    zoom:16,\n    extrainfo:\"Some extra information\"\n};\nmsg.payload = thing;\nmsg.payload.command =  {\n     layer:\"OSM\",  \n     lat:f_lat, \n     lon:f_lon,\n     zoom:16\n};\nreturn msg;","outputs":1,"noerr":0,"x":217,"y":81,"wires":[["8514277e.8776a"]]}]

Peter Scargill

unread,
May 30, 2016, 6:43:43 PM5/30/16
to node...@googlegroups.com

That’s what I did Dave…

 

msg.payload={name:"Joe", lat:51, lon:-1.05};

 

done in a function node feeding the map node – which is fed by a simple injector. Works a treat FOR THE EXAMPLE perhaps with a different name.

 

And if I change it to msg.payload={name:"Brian", lat:51, lon:-1.05};

 

and inject that after hitting refresh on the map – I get the nice red mark again – and it says Brian.. LOVELY.

 

But… if I change the coordinates – even slightly … for example

msg.payload={name:"Brian2", lat:52, lon:-1.05};

 

I get zilch – nothing – no red mark, no moving map to the new coordinates..

 

I am msg.payload = {name:"Pete", lat:37.73, lon:-2.55};

 

Under no circumstances do I see any marker, nor the map whizzing off to Spain.

 

The only thing that seems to work – is the example!   (obviously I have return msg; at the end of the function)

 

 

Pete.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/UkwR4MfoxzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
For more options, visit https://groups.google.com/d/optout.

Peter Scargill

unread,
May 30, 2016, 7:00:21 PM5/30/16
to node...@googlegroups.com

I’ve tried again with my Spanish address and realised that in fact I am there – the little red indicator – but the map made no attempt to move to that location – I had to find it. It just stays in England until you manually go zooming out… What am I missing, do you know?

 

From: node...@googlegroups.com [mailto:node...@googlegroups.com] On Behalf Of Dave C-J
Sent: 30 May 2016 23:26
To: node...@googlegroups.com
Subject: Re: [node-red] node-red-contrib-web-worldmap issues

 

Peter

--

Dave C-J

unread,
May 30, 2016, 7:05:35 PM5/30/16
to node...@googlegroups.com
Did you try hitting the hamburger menu icon top right ?

Peter Scargill

unread,
May 30, 2016, 7:22:12 PM5/30/16
to node...@googlegroups.com

Yes thanks once I got your email  - but you have to do that every time you start up the map…. Can we make that the default?  Surely that should be the default behaviour???

 

Pete.

 

From: node...@googlegroups.com [mailto:node...@googlegroups.com] On Behalf Of Dave C-J
Sent: 31 May 2016 01:06
To: node...@googlegroups.com
Subject: Re: [node-red] node-red-contrib-web-worldmap issues

 

Did you try hitting the hamburger menu icon top right ?

--

Peter Scargill

unread,
May 30, 2016, 7:25:15 PM5/30/16
to node...@googlegroups.com

Re; other email  - so I have to set that pan feature every time I start up the map – also the zoom level is right out – ie when it pans to my address in Spain – I can see most of Spain….yet the original London picture showed a small area. Again am I missing something – can’t see a zoom setting you can do in Node-Red…

 

Pete.

 

From: node...@googlegroups.com [mailto:node...@googlegroups.com] On Behalf Of Dave C-J


Sent: 31 May 2016 01:06

To: node...@googlegroups.com
Subject: Re: [node-red] node-red-contrib-web-worldmap issues

 

Did you try hitting the hamburger menu icon top right ?

--

Dave C-J

unread,
May 30, 2016, 7:26:14 PM5/30/16
to node...@googlegroups.com

Not when you are plotting lots of things. Bouncing around is very annoying. You can change the start position by going to where you want and selecting the map you want. Then going to menu and turn lock on, (and off again).

Dave C-J

unread,
May 30, 2016, 7:27:43 PM5/30/16
to node...@googlegroups.com

And zoom is standard + and - top left

Dave C-J

unread,
May 30, 2016, 7:29:58 PM5/30/16
to node...@googlegroups.com

Or mouse wheel. Or double click to zoom in.

Peter Scargill

unread,
May 30, 2016, 7:30:49 PM5/30/16
to node...@googlegroups.com

Ok, understand – not quite what I thought it was – thanks for the clarification – that’s great….

 

Just a thought – if it were possible to make both zoom and pan options controllable by node-red--- if I were taking in location info from say a moving mobile phone – tracking someone – I’d want it to stay zoomed in and tracking… that was more my line of thinking…

 

Pete.

--

Dave C-J

unread,
May 31, 2016, 2:07:26 AM5/31/16
to node...@googlegroups.com

peters...@googlemail.com

unread,
May 31, 2016, 3:06:51 AM5/31/16
to node...@googlegroups.com

Rarely :-) Ta.

On 31 May 2016 08:07:27 Dave C-J <dce...@gmail.com> wrote:

--

peters...@googlemail.com

unread,
May 31, 2016, 4:17:42 AM5/31/16
to node...@googlegroups.com

That command object... doc says send via websocket. Can you send that directly into the input as per the other input material example you gave???

On 31 May 2016 08:07:27 Dave C-J <dce...@gmail.com> wrote:

--

Dave C-J

unread,
May 31, 2016, 4:39:11 AM5/31/16
to node...@googlegroups.com
yes - used to use websocket - now all via the node... - docs now updated (v1.0.5)

peters...@googlemail.com

unread,
May 31, 2016, 4:50:21 AM5/31/16
to node...@googlegroups.com

Wonderful. Thank you!!

Pete

On 31 May 2016 10:39:12 Dave C-J <dce...@gmail.com> wrote:

yes - used to use websocket - now all via the node... - docs now updated (v1.0.5)

--

Julian Knight

unread,
Jun 1, 2016, 3:18:44 PM6/1/16
to Node-RED
Docu-what?

Peter Scargill

unread,
Jun 1, 2016, 4:02:03 PM6/1/16
to node...@googlegroups.com

My thoughts exactly but I’m very grateful for that link because actually, it was easy and solved my problem – maybe- in very FEW circumstances there is some justification for reading manuals. I wouldn’t do it for a living though J

 

 

From: node...@googlegroups.com [mailto:node...@googlegroups.com] On Behalf Of Julian Knight
Sent: 01 June 2016 21:19
To: Node-RED <node...@googlegroups.com>
Subject: Re: [node-red] node-red-contrib-web-worldmap issues

 

Docu-what?

--

Julian Knight

unread,
Jun 1, 2016, 4:07:17 PM6/1/16
to Node-RED, pe...@scargill.org
It is certainly a cool tool to use with NR. Now I just need to wire up OwnTracks!

Peter Scargill

unread,
Jun 1, 2016, 4:23:59 PM6/1/16
to node...@googlegroups.com

Yup – that’s EXACTLY what I was thinking – but let us know if you get the latter to work reliably. When I tried Cloudtrax – going in and out of WIFI and GPRS etc… eventually it would lose the plot – it might have improved…

 

Between the two of them – we have ourselves a tracking system J

Julian Knight

unread,
Jun 1, 2016, 4:43:19 PM6/1/16
to Node-RED, pe...@scargill.org
Yes, I need an Internet facing MQTT server though ... screeetch! Just realised that you can now use OwnTracks with an http(s) end point rather than an Internet facing MQTT server. That's much easier to set up and secure so I should probably give that a go.

I've just been spending what little time I have installing and securing a new router and Wifi access point for chez knight and then reconfiguring the router and my NAS to provide proxied https access to some of the in-house web pages. So setting up an end point for OwnTracks would probably be an excellent next step. I was going to set up MQTT on a spare VPS that is about to be used for my sons Duke of Edinburgh award skills project but that is little way away yet.

By the way, if anyone is currently looking for a new home router and is prepared to work slightly harder to set things up than the standard fair, I can heartily recommend Ubiquiti Networks kit. Just got a massive improvement in throughput, security and WiFi coverage for less than the cost of a decent home Wireless AC router.

Steve French

unread,
Jun 3, 2016, 1:09:26 PM6/3/16
to Node-RED
Julian,
Indeed I have had my eye on the products from Ubiquiti networks... like these access points.  Which product are you referring to (one of these?)? Thanks!
-frenchy (Steve French)

Dave C-J

unread,
Jun 3, 2016, 1:18:21 PM6/3/16
to node...@googlegroups.com

We're well off topic now but hey...

I've also just recently installed one of their AC-lite access points. Brilliant so far. Rock solid, better signal range, config was not hard, and so far I seem to be the only 5ghz ap around...

Surely tempted to turn on the visitor landing page with credit card, to limit the kids :-)

Julian Knight

unread,
Jun 3, 2016, 1:29:50 PM6/3/16
to Node-RED
Yup. The EdgeRouter Lite 3-port and a UniFi AC-LR. The LR is actually a little cheaper than the standard AC at the moment oddly.

They have transformed my home network from a source of family frustration to a joy! Well that and doubling the broadband speed! The forums are also good and the support team jumped right into one of my questions and came up with a new knowledge article within 24hrs. Documentation can be sketchy in places, especially for the router as EdgeOS builds on Vyetta, an age-old Router OS. Needs a bit of work if you want to go beyond the default settings but well worth the effort. I now have a network-wide dynamically updated firewall that blocks adverts (at work, our only successful malware attack seems to have happened via a drive-by malvert from LinkedIn), known malware sites and the like, updates overnight.

I like Dave's idea of the kids having their own wifi with charges!! My AP now reaches all the way from the loft where the router and AP are located to the basement! No more wifi extenders that don't work properly for us!

Dave C-J

unread,
Jun 12, 2016, 7:42:52 AM6/12/16
to node...@googlegroups.com
Back on thread... I have just pushed version 1.0.12 of node-red-contrib-web-worldmap that lets you set initial start position and zoom and layer within the config of the node.

Peter Scargill

unread,
Jun 12, 2016, 9:17:24 AM6/12/16
to Node-RED
Excellent - I've just updated my various installations.

Marko S

unread,
Jun 12, 2016, 12:01:23 PM6/12/16
to Node-RED
Dceejay, why this:

[{"id":"81bdd48.4b80428","type":"worldmap in","z":"5cd14454.a32ebc","name":"","x":950,"y":516,"wires":[["53244807.9b6d38"]]},{"id":"53244807.9b6d38","type":"function","z":"5cd14454.a32ebc","name":"filter","func":"if (msg.payload.action === \"connected\") { return msg; }\n\nreturn null;","outputs":1,"noerr":0,"x":1120,"y":516,"wires":[["9c3a4397.a8ea7"]]}]

Doesn't help me that the redmap retains the new maps that I inject? (the mapbox ones)


Dne nedelja, 12. junij 2016 15.17.24 UTC+2 je oseba Peter Scargill napisala:

Dave C-J

unread,
Jun 12, 2016, 12:09:47 PM6/12/16
to node...@googlegroups.com
Sorry - going to need more context... "why this" where ?
that is just an example if you want to use it to see events coming back from the web map... in this case filtering out the connected message in order to trigger some action.

Marko S

unread,
Jun 12, 2016, 2:30:15 PM6/12/16
to Node-RED
if I wanted 4 more mapbox maps there in worldmap to be inside the layers dialogue, I have to wait for the worldmap to load then i need to go into the nodered editor and press inject and dunno maybe also reload the map and there they are the 4 additional maps...How would I automate this. That I don't need to press that inject. 

Dne nedelja, 12. junij 2016 18.09.47 UTC+2 je oseba Dave C-J napisala:

Dave C-J

unread,
Jun 12, 2016, 2:45:25 PM6/12/16
to node...@googlegroups.com
that is exactly what that flow snippet does... replaces the inject in you description above. Did you actually try it ?

Marko S

unread,
Jun 12, 2016, 2:50:29 PM6/12/16
to Node-RED
Yes I did but I might be using it incorrectly, so I should remove the inject node and connect to the filter...maybe I used it incorrectly..

Dne nedelja, 12. junij 2016 20.45.25 UTC+2 je oseba Dave C-J napisala:

Marko S

unread,
Jun 12, 2016, 2:51:55 PM6/12/16
to Node-RED
Yep my bad I was using it wrong :), it works yeah :D.

Dne nedelja, 12. junij 2016 20.50.29 UTC+2 je oseba Marko S napisala:

Rajat Sud

unread,
Jun 18, 2016, 3:49:10 AM6/18/16
to Node-RED
This was working for me. I did a update to 0.0.13 and it stubbornly does not update anything. I removed the earlier flows and just tried the examples. The node loads without errors but when inject nothing happens. It opens the map with Winchester at the centre and does not respond to any updates or insertions to add markers. Before the upgrade this was working fine.
Here is the nodeversion and the flow i am executing
18 Jun 12:35:01 - [info] Node-RED version: v0.13.4
18 Jun 12:35:01 - [info] Node.js  version: v4.4.5
18 Jun 12:35:01 - [info] Windows_NT 10.0.10240 x64 LE

 [{"id":"1849c96f.c17aaf","type":"function","z":"73f24cdc.dacce4","name":"Add thing to map","func":"var thing = {\n    name:\"Wally\", \n    lat:51, \n    lon:-1.45,\n    icon:\"car\",\n    iconColor:\"darkred\",\n    extrainfo:\"Some extra information\"\n};\nmsg.payload = thing;\nreturn msg;","outputs":1,"noerr":0,"x":654.0000305175781,"y":798.86669921875,"wires":[["e3026628.673928"]]},{"id":"9bc5dc6f.61f2e8","type":"worldmap","z":"73f24cdc.dacce4","lat":"78","lon":"12","zoom":"12","layer":"Esri","cluster":"12","maxage":"1","name":"","x":857.0000305175781,"y":344.8666687011719,"wires":[]},{"id":"d51ef6be.87e3c","type":"inject","z":"73f24cdc.dacce4","name":"","topic":"","payload":"","payloadType":"none","repeat":"","crontab":"","once":false,"x":297.0000305175781,"y":304.8666687011719,"wires":[["b26a3734.172288"]]},{"id":"b26a3734.172288","type":"function","z":"73f24cdc.dacce4","name":"add new layer","func":"msg.payload = {};\nmsg.payload.command = {};\n\nvar u = 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png';\nvar o = JSON.stringify({ maxZoom: 19, attribution: '&copy; OpenStreetMap'});\n\nmsg.payload.command.map = {name:\"OSMhot\", url:u, opt:o};\nmsg.payload.command.layer = \"OSMhot\";\n\nreturn msg;","outputs":1,"noerr":0,"x":527.0000305175781,"y":304.8666687011719,"wires":[["9bc5dc6f.61f2e8","6721a8b5.cbca98"]]},{"id":"3c1787ac.d215f","type":"function","z":"73f24cdc.dacce4","name":"USGS Quake monitor csv re-parse","func":"msg.payload.lat = msg.payload.latitude;\nmsg.payload.lon = msg.payload.longitude;\nmsg.payload.layer = \"earthquake\";\nmsg.payload.name = msg.payload.id;\nmsg.payload.icon = \"globe\";\nmsg.payload.iconColor = \"orange\";\n\ndelete msg.payload.latitude;\ndelete msg.payload.longitude;\t\nreturn msg;","outputs":1,"noerr":0,"x":647.0000305175781,"y":444.8666687011719,"wires":[["9bc5dc6f.61f2e8","6721a8b5.cbca98"]]},{"id":"63280f1e.a8f6f8","type":"function","z":"73f24cdc.dacce4","name":"move and zoom","func":"msg.payload.command =  {layer:\"Esri Relief\", lat:12, lon:71, zoom:10 };\nreturn msg;","outputs":1,"noerr":0,"x":527.0000305175781,"y":344.8666687011719,"wires":[["9bc5dc6f.61f2e8","6721a8b5.cbca98"]]},{"id":"7f93d6cd.d60908","type":"csv","z":"73f24cdc.dacce4","name":"","sep":",","hdrin":true,"hdrout":"","multi":"one","ret":"\\n","temp":"","x":497.0000305175781,"y":384.8666687011719,"wires":[["3c1787ac.d215f"]]},{"id":"8c494e12.c8ef38","type":"inject","z":"73f24cdc.dacce4","name":"","topic":"","payload":"","payloadType":"none","repeat":"","crontab":"","once":false,"x":297.0000305175781,"y":344.8666687011719,"wires":[["63280f1e.a8f6f8"]]},{"id":"91764cd3.3068d","type":"http request","z":"73f24cdc.dacce4","name":"","method":"GET","url":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.csv","x":377.0000305175781,"y":444.8666687011719,"wires":[["7f93d6cd.d60908"]]},{"id":"1c71c0bd.27767f","type":"inject","z":"73f24cdc.dacce4","name":"Quakes","topic":"","payload":"","payloadType":"none","repeat":"900","crontab":"","once":false,"x":307.0000305175781,"y":384.8666687011719,"wires":[["91764cd3.3068d"]]},{"id":"6721a8b5.cbca98","type":"debug","z":"73f24cdc.dacce4","name":"","active":true,"console":"false","complete":"false","x":793.4666442871094,"y":251.76666259765625,"wires":[]},{"id":"4f6bf297.30d11c","type":"worldmap in","z":"73f24cdc.dacce4","name":"","x":515.86669921875,"y":628.86669921875,"wires":[["52a65b1d.5809fc"]]},{"id":"52a65b1d.5809fc","type":"function","z":"73f24cdc.dacce4","name":"filter","func":"if (msg.payload.action === \"connected\") { return msg; }\n\nreturn null;","outputs":1,"noerr":0,"x":685.86669921875,"y":628.86669921875,"wires":[["6721a8b5.cbca98"]]},{"id":"e3026628.673928","type":"worldmap","z":"73f24cdc.dacce4","name":"","x":894.0000305175781,"y":798.86669921875,"wires":[]},{"id":"ef52f385.665a7","type":"inject","z":"73f24cdc.dacce4","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":464.0000305175781,"y":798.86669921875,"wires":[["1849c96f.c17aaf"]]},{"id":"6a778e5e.094e2","type":"comment","z":"73f24cdc.dacce4","name":"Simple map - click inject to send thing to map.","info":"Adds a map at http://(your-server-ip):1880/worldmap. \n\nThe `function` node creates an object with some basic properties required to add to a map.","x":594.0000305175781,"y":738.86669921875,"wires":[]}]

Dave C-J

unread,
Jun 18, 2016, 4:33:03 AM6/18/16
to node...@googlegroups.com
Hi,
well - yes - does highlight something. you have two worldmap nodes with different settings - one of which is set to remove markers after one second... so you are unlikely to see them. It also starts the map somewhere in the sea off Greenland.  Current advice would be to only have one worldmap node on your flow - and make sure the settings are as you expect.

Ty George

unread,
Aug 5, 2016, 8:53:07 PM8/5/16
to Node-RED
Anyone got an example flow i can look at that is pushing 2 different cords to the map and drawing a line between them?

I can't seem to figure out the formatting of the payload to generate a line between two places. ... any help would be appreciated :) 

Thanks,
Ty

Dave C-J

unread,
Aug 6, 2016, 8:57:26 AM8/6/16
to node...@googlegroups.com
Hi

but for example import this

[{"id":"dae63600.739708","type":"inject","z":"896b28a8.437658","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":123,"y":1008,"wires":[["8d064bf3.4d9f68"]]},{"id":"8d064bf3.4d9f68","type":"function","z":"896b28a8.437658","name":"","func":"msg.payload = {name:\"mytrack\",line:[ [51.05, -0.08], [51.5, -1], [51.2, -0.047] ]};\nreturn msg;","outputs":1,"noerr":0,"x":295,"y":1027,"wires":[["a733a03e.317f2"]]}]

The ThingBox

unread,
Aug 16, 2016, 11:57:03 PM8/16/16
to Node-RED
should be part of the dashboard!
Reply all
Reply to author
Forward
0 new messages