I have posts with custom map and marker(s) created by Maps plugin. In my content template I managed to control map inital zoom for single-marker maps via custom field.
And now: for maps with multiple markers, I need to keep the map center for each map to show all markers but still I would like to control the initial zoom via another custom field.
For example: I would like to have several markers placed on streets in a city center. Map plugin adjusts the initial zoom to show them all at once correctly but the zoom value of the map is too high for my purposes. I would like to be able to see whole city initially, yet all the markers in the center of the map. So each map with multiple markers will have different zoom level (controlled by the custom field in the backend administration)
Thanks in advance,
Tom
Dear Tom,
It is possible to setup Google map general zoom value using attribute "general_zoom", see our document:
https://toolset.com/documentation/user-guides/maps-shortcodes/#wpv-map-render
Arguments "general_zoom": When fitbounds is set to off, this one sets the zoom level of the map.
For example:
[wpv-map-render fitbounds="off" general_zoom="6" ... ]
Hello, Luo,
thanks for your reply.
I am aware of the "general_zoom" attribute, but if I use combination of fitbounds="off" and general_zoom="6", the map centers somewhere into ocean because of the default center set in the content template. Each of my maps shows totally different location therefore it is not possible to set one center point in the content template.
What I need is to make use of the " fitbounds="on" " attribute (to center the map and show all markers at once) combined with "general_zoom" to zoom out at will.
Thanks very much for your help
For the question:
What I need is to make use of the " fitbounds="on" " attribute (to center the map and show all markers at once) combined with "general_zoom" to zoom out at will.
As you can see, there isn't such a built-in feature within Toolset Maps plugin:
If you are using attribute "general_zoom", "fitbounds" attribute is required to be setup as "off", as a result, you will need to setup the center of map with attributes "general_center_lat" and "general_center_lon" manually .
I suggest you add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Our developers will evaluate it.
ok, understood. I was hoping for some kind of workaround 🙂
Thanks for your assistance