Using Google maps as a menu Part 2

This 7m 18s video continues form the part 1 video Using Google Maps as a menu and discusses dynamic map centres, zoom levels, clustering, layers and themes.

NOTE The theme bug mentioned in this video has now been fixed

Hi Brian. Is it possible to set the map zoom and center to neatly show all the dynamic markers? I will have them in all kinds of places but in regions (my markers are related to airports) so the zoom level and center needs to be dynamic so you see all the markers for the selected airport. I know Google maps can handle this but can’t see how to achieve it in Wappler.

Not directly but within the definition there is a statement zoom-control zoom="12"

Not tried it but perhaps you could try manually editing to something like :
dmx-bind:"zoom-control zoom={{dynamicvalue}}"
which should allow that value to become dynamic (hope i got the syntax correct)
You can already set the map centre dynamically within the dynamic attributes


But of course you would have to calculate the appropriate zoom and centre positions before setting them

I guess some sort of “Auto zoom and centre to markers” type property would be a great addition, may be worth a feature request?

Thanks for the speedy reply, Brian. Yep, really needs to be an ‘auto zoom and centre to markers’ solution so I’ll post a feature request.