How to Control Zoom Level When Clicking Markers in WP Go Maps
Content
Many users of the WP Go Maps (formerly WP Google Maps) plugin want to control the zoom level that occurs when a visitor clicks on a marker in the marker listing or directly on the map. By default, the plugin may zoom in very close to the marker, which can be disorienting on large maps where an overview is preferred.
Why This Happens
The plugin's default behavior is designed to focus intently on a single location when it is selected. This is controlled by the Google Maps API integration within the plugin's code. For users with maps covering a large geographical area, this intense zoom can make it difficult for visitors to maintain their spatial context.
Common Solutions
1. Check for a Built-in Setting (Basic Version)
First, navigate to your map's settings within the WordPress admin area. Go to Maps -> Edit [Your Map] -> Advanced Settings. Look for any options related to zoom behavior on click. Based on community threads, a direct setting for this specific behavior may not be available in the basic version, but it's always best to check here first for any new options.
2. Manual Code Modification (For Basic Version)
This solution requires editing plugin files. Warning: Any changes made directly to plugin files will be overwritten when the plugin is updated. It is highly recommended to use a child theme and consider functionality for re-applying changes after updates.
As referenced in the community, you may need to locate and modify the JavaScript responsible for the click event. The specific code will vary depending on your plugin version. You would need to find the event listener for the marker 'click' event and modify the setZoom() method or similar parameters within it to a lower value. Without direct access to your specific code, providing exact lines is difficult. This often requires a comfort level with JavaScript and PHP.
3. Investigate Pro Version Features
Several user questions regarding advanced marker behavior, including clustering and zoom controls, were directed to the official 'WP Go Maps' support desk, as they relate to features available in the Pro add-on. The team behind 'WP Go Maps' often implements user-requested features in new releases. If this functionality is critical for your project, you may want to investigate whether the Pro version offers a more user-friendly solution for controlling zoom levels.
Important Note on Support
These forums on WordPress.org are strictly for support with the core basic version of the WP Go Maps plugin. According to the guidelines, the developers cannot provide support for Pro-related features here. For assistance with Pro add-ons, users are advised to contact the 'WP Go Maps' team directly through their official website.
If you have found another method for controlling the zoom level on click, please share your solution in the comments to help other users.
Related Support Threads Support
-
zoom level marker listing linkhttps://wordpress.org/support/topic/zoom-level-marker-listing-link/
-
Advance marker size.https://wordpress.org/support/topic/advance-marker-size/
-
Disable marker change on hoverhttps://wordpress.org/support/topic/disable-marker-change-on-hover/
-
How to switch off Google Place Markershttps://wordpress.org/support/topic/how-to-switch-off-google-place-markers/
-
Default Viewhttps://wordpress.org/support/topic/default-view-6/
-
Infowindow – make width auto?https://wordpress.org/support/topic/infowindow-make-width-auto/
-
Change Zoom Level based on Screen Size?https://wordpress.org/support/topic/change-zoom-level-based-on-screen-size/
-
How to select other resolution pictureshttps://wordpress.org/support/topic/how-to-select-other-resolution-pictures/
-
When custom markers overlap they changehttps://wordpress.org/support/topic/when-custom-markers-overlap-they-change/
-
Limiting preview text for advanced table formathttps://wordpress.org/support/topic/limiting-preview-text-for-advanced-table-format/
-
Remove custom markerhttps://wordpress.org/support/topic/remove-custom-marker/
-
Set marker as Default From Location in Get Directionshttps://wordpress.org/support/topic/set-marker-as-default-from-location-in-get-directions/
-
Change default radiushttps://wordpress.org/support/topic/change-default-radius/
-
Size of cloudhttps://wordpress.org/support/topic/size-of-cloud/
-
Zoom after clicking on marker iconhttps://wordpress.org/support/topic/zoom-after-clicking-on-marker-icon/
-
hook wpgmp_markers overridden by filterhttps://wordpress.org/support/topic/hook-wpgmp_markers-overridden-by-filter/
-
Sticky Marker when filteringhttps://wordpress.org/support/topic/sticky-marker-when-filtering/
-
No “Default Marker Image” in settingshttps://wordpress.org/support/topic/no-default-marker-image-in-settings/
-
update map on the flyhttps://wordpress.org/support/topic/update-map-on-the-fly/
-
unclickable Markerhttps://wordpress.org/support/topic/unclickable-marker/
-
Can I hide accommodation markers on my map?https://wordpress.org/support/topic/can-i-hide-accommodation-markers-on-my-map/
-
Change color Jsonhttps://wordpress.org/support/topic/change-color-json/
-
Default Pins on .kml polygonshttps://wordpress.org/support/topic/default-pins-on-kml-polygons/
-
Remove click eventhttps://wordpress.org/support/topic/remove-click-event/