Skip Navigation

[Resolved] Map “adjust automatically to show all markers at once” with initial zoom

This thread is resolved. Here is a description of the problem and solution.

Problem:

In map shortcode [wpv-map-render], 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.

Solution:

There isn't such a built-in feature within Toolset Maps plugin:

https://toolset.com/forums/topic/map-adjust-automatically-to-show-all-markers-at-once-with-initial-zoom/#post-1214552

Relevant Documentation:

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by tomasP 5 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1214399

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

#1214529

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"  ... ]
#1214541

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

#1214552

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.

#1214572

ok, understood. I was hoping for some kind of workaround 🙂
Thanks for your assistance

#1214573