Passer la navigation

[Résolu] "Focus Marker Map" only clicks-to first listing in results

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

Fuseau horaire du supporter : Asia/Hong_Kong (GMT+08:00)

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

Dernière mise à jour par stuartF-2 Il y a 3 years, 7 months.

Assisté par: Luo Yang.

Auteur
Publications
#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 lien caché

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:
lien caché

Map page:
lien caché
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]

<em><u>lien caché</u></em>

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:
lien caché

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