Possibility to move the world map legend

I managed to get the legend on the node red world map. It seems to be displayed only in the bottom left corner of the map. Is it possible to move it to the top right corner of the map??

Sorry - no - currently it is fixed to bottom left, as there are usually a lot of other controls like layers top right.

You could hack the source line 905 for worldmap/worldmap.js

Ah man. Cool, im not so adept in node red to tweak something the way you said. Haha.

Also, i had another doubt. I went through the documentation and saw how to insert a button in the pop up on the world map. How can i make the button click do something like zoom to a gps location with a specific zoom level?

Appreciate any help. Been stuck on this for a while now :frowning:

hmm - not sure editing one line of code to change bottom-left to top-right is too hard...

sending a payload like will create button that will zoom to a location

{"lat":51.05,"lon":-1.35,"name":"Test","popup":"<button onclick=\"map.setView([51,0],5);\">Click</button>"}

Will edit the legend line soon and revert back on its success!

But using an inject node with the data you shared and wiring it to the map didn't seem to do anything. am i missing something?

@dceejay Fixed it, this is awesome !
Thanks a ton !

Is it possible to dynamically set the lat, lon and zoom in the popup string in your example?
I tried using $ followed by my variable, but that doesn't work

msg.payload is just a JavaScript string so build it as you would any other variable.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.