Skip Navigation

[Resolved] Find on Map button causes multiple Markers to open in the same location

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a View that displays results on a Google Map. When I click the Focus on Map button, the Map Marker opens and appears in the wrong location. All the markers seem to open in the same location.

Solution: An erratum post with a patch file has been published about this issue.

Relevant Documentation:
https://toolset.com/errata/focus-on-map-links-focus-on-the-wrong-location-if-wpml-is-active/

This support ticket is created 6 years, 2 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by katerinaA 6 years ago.

Assisted by: Christian Cox.

Author
Posts
#610397

I am trying to:
To use Toolset Maps

Link to a page where the issue can be seen:
hidden link

I expected to see:
When I click on "Find On Map" button to open the according pin in the correct location

Instead, I got:
After a few clicks, most of the pins open in the same location in the map.
----------------------------------------------------------------------------------------------------------------------
Dear Sirs,

We are using toolset plugin for a significant period of time and we are very satisfied with it. Recently we used the map option, as it can be seen here:
hidden link

While the map works perfectly, the locations on the left side of the map with "Find On Map" buttons don't work as expected. After a couple of clicks, every "Find On Map" button, opens the same pin on the map. (The info box is the correct one but the pin location is completely wrong)

With the previous version of toolset, I managed to overcome this problem. The solution was to initialize the map everytime before opening the pin (with WPViews.view_addon_maps.reload_map('map-1') function).

After the last update this trick doesn't work anymore.

Can you provide us with a more appropriate solution?

Thank you.

#610484

Hi, I applied this updated code for your FIND ON MAP links instead:

<a href="#" class="js-wpv-addon-maps-focus-map js-toolset-maps-open-infowindow-map-1-marker-[wpv-post-id]" data-map="map-1" data-marker="marker-[wpv-post-id]">FIND ON MAP</a>

The reloadmap() function should not be necessary anymore. Can you check the functionality of each "Find on Map" link and confirm things are working as expected?

If not, here is the old code, which you can replace if necessary:

[wpv-post-title] <a href="javascript:void(0);" onclick="reloadmap();" class="js-wpv-addon-maps-focus-map js-toolset-maps-hover-map-map-1-marker-marker-[wpv-post-id] js-toolset-maps-open-infowindow-map-map-1-marker-marker-[wpv-post-id]" data-map="map-1" data-marker="marker-[wpv-post-id]">FIND ON MAP</a>
#610505

Hi,

Thank you for the answer.
Now it works partially. When I click the "Find On Map" button, the map focuses everytime in the correct pin but it doesn't open the info box (as it did before)...

How can I have the info box upon clicking the "Find On Map" button?

Regards,

#610757

Hi, I have temporarily deactivated the "cluster" option on this map, and the behavior seems to be correct. The map markers are appearing in the proper locations, the map is refocusing correctly, and the marker popups are displaying automatically. Please take a look. Here is the new map shortcode:

[wpv-map-render map_id="map-1" map_height="40vw" marker_icon="<em><u>hidden link</u></em>" marker_icon_hover="<em><u>hidden link</u></em>"]

However, this should not be necessary. Please stand by while I do some additional testing and I will update you shortly.

#610769

Okay I have been able to reproduce this on my own local environment starting from a fresh site installation with only Types, Views, Maps, and WPML active. So I have escalated the issue to my 2nd tier support team for additional investigation. I will update you as soon as I have additional information to share, but for now, it appears that disabling "clustering" on the map is a possible workaround.

#692462

Hello, our developers have released a patch for this issue in the erratum post here:
https://toolset.com/errata/focus-on-map-links-focus-on-the-wrong-location-if-wpml-is-active/
Please follow the instructions there to apply the patch, then clear your browser cache and test again. Let me know if the problem is not resolved.

#693025
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.