using Maps in Toolset (specifically Google Maps) is there a way to have button or a link set a specific zoom level - .e.g zoom level 4.
What I would like to do is have a map view that allows the client to have 3 specific zoom levels they can use with the click of a button, rather than using the standard controls to zoom in - just one click and they are at the correct desired level.
They are going to be using this in presentations and will need it to be easy to zoom an focus - Zoom 1 (far out, all markers), Zoom 2 (Closer, view roads nearby etc), Zoom 3 (Max on the building, or land).
is it possible, I will assume it is as this posts eludes to something similar, but I wondered if you have any snippets that would help me implement such a thing:
https://toolset.com/forums/topic/changing-the-zoom-level-via-js/
🙂 thanks
Hi,
For what you're planning, Toolset map offers some built-in options.
( screenshot attached from the "Fields and Views" button )
With the default settings, when the map loads, it shows with maximum zoom-in level possible, while ensuring that all the available map markers are visible. This is what can serve as your zoom 1 option and you can add a "zoom-out" link which will always revert the map to this default state.
Example:
<a href="#" class="js-wpv-addon-maps-restore-map" data-map="map-1">Default Map</a>
Please replace "map-1" with your actual map's ID.
For zoom 2, you can use the "focus on marker" option, which will focus the map to the specific marker and its surroundings on the map:
<a href="#" class="js-wpv-addon-maps-focus-map" data-map="map-1" data-marker="marker-[wpv-post-id]">focus on marker</a>
Please replace "map-1" with your actual map's ID and "marker-[wpv-post-id]" with the actual format of the map marker IDs that you're using.
For the maximum closed in zoom 3, there is no built-in option but you can use the custom link for the street view that opens it in a new tab instead of the map on the same page, as discussed in the other ticket.
( ref: https://toolset.com/forums/topic/click-to-direct-streetview-of-location/ )
regards,
Waqar
My issue is resolved now. Thank you!