Skip Navigation

[Resolved] Set a default level of zoom for a map with many pins.

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

Problem:

Setup the center of Google map when "fitbounds" is off.

Solution:

You can try the attributes general_center_lat and general_center_lon, see our document:

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-render

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.

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 3 replies, has 2 voices.

Last updated by Stephen Vaughan 1 year, 3 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#2137979
Not-correct.png
Correct.png

I have a map in a layout which is tied to a listing of locations. Ideally I want the map to render to show the whole of Ireland on page load so there is a proper context for seeing the country. What is annoying is where there are only a certain number of location pins the view of the country is cropped. See the first image. From experience to get the full view of the country you need to have a location pin in the North and another down at the southern tip of the country. I think there should be a way to set a default zoom level sot that the country can be seen fully like in the second image upload.

I have looked at some of the following suggestions but they don't seem to work?

#2138041
General-Zoom-3-Bounds-off.png
Generl-zoom-1-bounds-off.png

Some test so far:

If I use the following the map does its supper zoom out, seems to work and you can click into the clustered pins:
general_zoom="1" fitbounds="off"

But, if you start to adjust the general zoom in closer it start to look broken:
general_zoom="3" fitbounds="off"

The above is working but is not entering around the pins. You can see them if you drag the map down.

#2138543

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

You can try the attributes general_center_lat and general_center_lon, see our document:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-render
general_center_lat and general_center_lon. Optional, coordinates for the map center when fitbounds is set to off

#2138639

My issue is resolved now. Thank you! That worked perfectly.