Skip Navigation

[Resolved] "Focus Marker Map" only clicks-to first listing in results

This support ticket is created 3 years, 3 months ago. 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.

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)

This topic contains 2 replies, has 2 voices.

Last updated by stuartF-2 3 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#2496315
Screen Shot 2022-11-14 at 2.54.04 PM.png
Screen Shot 2022-11-14 at 2.53.56 PM.png
Screen Shot 2022-11-14 at 2.53.23 PM.png
Screen Shot 2022-11-14 at 2.53.14 PM.png

Hello, we've set up our View with Search and Map using the Block Editor. We then added the "Focus Map Marker" button to our View Output and entered all the required information in the block fields to connect it to our Map on the same page.

The problem, is that when you click the "focus map marker" button it only opens the infowindow for the first listing. Why is it not identifying the correct marker for each listing?

Toolset View and Map can be seen on this page hidden link

See screenshots of settings for button and map. Thank you.

#2496581

Hello,

The "Focus on map" button requires each marker uses unique marker ID, see below test site:
Login URL:
hidden link

Map page:
hidden link
1) In view's loop, display a shortcode block, with the marker shortcode + "Focus on map" shortcode:

[wpv-map-marker map_id='map-2' marker_id='marker-[wpv-post-id]' marker_field='wpcf-test-address-1'][wpv-post-title][/wpv-map-marker]

<a href="#" class="js-wpv-addon-maps-focus-map js-toolset-maps-open-infowindow-map-map-2-marker-marker-[wpv-post-id]" data-map="map-2" data-marker="marker-[wpv-post-id]">view on map</a>

Each marker will use an unique ID: marker-[wpv-post-id]

2) In the map block, you don't need to setup the maker source

Test it in frontend:
hidden link

click on the link "view on map", It works fine

More help:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#map-focus-on-marker
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker

#2496863

Thank you for the instructions and the demo site for reference. With that I was able to replicate the correct setup on my site and get it working. My issue is resolved now.4