Skip Navigation

[Résolu] Set a default level of zoom for a map with many pins.

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 Il y a 3 années et 3 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par Stephen Vaughan Il y a 3 années et 3 mois.

Assisté par: Luo Yang.

Auteur
Publications
#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.