Zoom to Location on ui-Worldmap

I am trying to map my family phones on a ui-worldmap.

I have them mapping ok. But I would like to change the zoom and location so they all fit in the screen.

I cant work out if this is possible.

I thought this would do it, but it seems to have no affect.

msg.payload.command = {};
msg.payload.command = {map: {

"fit": true,
"clickable": false


Not quite that simple but it can be done... you need to use a convex-hull node - this creates a shape that would hold all the points - and then make the shape itself invisible - and then fit the map to that.
(You will also need worldmap version 2.23.4 :slight_smile:

[{"id":"4b5f6be5.96c1f4","type":"worldmap-hull","z":"846d7832.3348c8","name":"","prop":"layer","x":520,"y":270,"wires":[["889b0e44.4fc8b","bc417f3349e3925a"]]},{"id":"bc417f3349e3925a","type":"function","z":"846d7832.3348c8","name":"","func":"msg.payload.fit = true;\nmsg.payload.fillOpacity = 0;\nmsg.payload.opacity = 0;\ndelete msg.payload.clickable;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":270,"wires":[["fd654fbf.7e7db"]]}]

that was perfect.. thank you!

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