Hello,
I have a very long list of posts, and when clicking on "center on the map", the page should go to top in order to see the map. How may I achieve this ?
Thank you.
Feel free to replace the class "js-wpv-addon-maps-focus-map" with the actual class attached to your marker focus link and the ID "js-wpv-addon-maps-render-map-1" with actual ID of your map's container.
For a more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors: https://toolset.com/contractors/
To make the marker's popup window also open when the "focus on marker" link is clicked, you'll find a "Clicking this item will also open the marker popup" checkbox, on the "Interaction" tab (when adding the focus on marker link).
( screenshot: hidden link )
For an already added link, you can include a special class "js-toolset-maps-open-infowindow-map-map-ID-marker-marker-ID" to it.
(where you'll replace "map-ID" with map's actual ID and "marker-ID" with the marker's actual ID)
For example, if your existing link's code is:
<a href="#" class="js-wpv-addon-maps-focus-map" data-map="map-1" data-marker="marker-[wpv-post-id]">Show on map</a>
It will become:
<a href="#" class="js-wpv-addon-maps-focus-map js-toolset-maps-open-infowindow-map-map-1-marker-marker-[wpv-post-id]" data-map="map-1" data-marker="marker-[wpv-post-id]">Show on map</a>
Nevertheless, I just noticed a small problem with the "totop" functionality : I use a sticky header, and the top part of the map is hidden by it. Would it be easily possible to improve ?