Worldmap base map shows then location in settings

#1

node-red-contrib-web-worldmap v1.5.36
In the node's configuration, I've set the latitude and longitude and when I first open the webpage everythnig is fine it shows the correct location. But when I do a refresh in the browser, the default map location shows for a moment before my location shows up. Is this expected behavior?

0 Likes

#2

Yes. The web page starts to load, and at same time starts a web socket. On connection the server tells it the correct location. If the map server is slow then the old one may show before the new one arrives.

1 Like

#3

@dceejay one other quick question - is it possible to pass the map startup location in a msg property? I've tried a couple things but it doesn't seem like you are able to do it.

@dynamicdave and I are working on a project to demonstrate IOT for kids using Wemos's with sensors meassuring temperature, humidity and pressure, and sending them to NR. Each user will have their own ID in the flow with their lat/lon associated and I'd like the world map to open centered on thier location.

While they could edit the worldmap node, this would make it easier since this project has been growing...how do I say it...due to over enthustic overseers. (oops, this was a little more than a quick question :grin:)

0 Likes

#4

you can set the startup location, zoom and map in the node config.
If you want to do it via a message then you use a worldmap input node to watch for the "connected" action and use that to send a command message as per the readme - https://www.npmjs.com/package/node-red-contrib-web-worldmap#to-switch-layer-move-map-and-zoom

1 Like

#5

Oh I love it where there is a way to do what I want. Thanks!!1

0 Likes