Skip Navigation

[Gelöst] Set a default level of zoom for a map with many pins.

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 support ticket is created vor 3 Jahren, 3 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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)

Dieses Thema enthält 3 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Stephen Vaughan vor 3 Jahren, 3 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#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

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.