Skip Navigation

[Resolved] Maps clustering not working as expected

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 8 replies, has 2 voices.

Last updated by Christian Cox 3 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#2135807
Cluster.png

I have several hundred items displaying on a map, using version 2.0.8 of Toolset Maps. When I enable clustering, it doesn't work as expected. Say an initial cluster marker shows there are 9 items. I click that and see more cluster markers, indicating, say, 2 items each -- but in fact, they're not additional clusters but the locations of listings. So I should be seeing the map marker, not the cluster marker. See attached image.

I'm also using custom map markers, but disabling those doesn't seem to help. Below is the map loop code. The Inspector doesn't show any errors. Any ideas?

<div>
[wpv-map-render map_id="map-3-1" map_height="650" fitbounds="on" cluster="on" spiderfy="off" scrollwheel="on" single_zoom="14"][/wpv-map-render]
</div>

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-map-marker map_id='map-3-1' marker_id='marker-[wpv-post-id]' marker_field='wpcf-google-address' marker_icon='[wpv-post-body view_template="marker-image"]']
<p style='font-size: 1.5em;'>
<b>
 [wpv-post-link]
</b></span>
</p>
<p style='font-size: 1.2em;'>[types field='street'], [types field='city'] ON</p>
<b>[wpv-post-taxonomy type="vendor-type" format="name"]</b>
[/wpv-map-marker]

[wpv-post-body view_template="loop-item-in-vendor-map"]
</wpv-loop>

<!-- wpv-loop-end -->
[/wpv-items-found]

[wpv-no-items-found]
<div class="noitems">[wpml-string context="wpv-views"]No items found[/wpml-string]</div>
[/wpv-no-items-found]

[wpv-layout-end]

#2136975

Hi, is it possible that the two markers here are just in the exact same location? For example, if you turn on spiderfy, does this help split those two markers shown in the same spot?

[wpv-map-render map_id="map-3-1" map_height="650" fitbounds="on" cluster="on" spiderfy="on" scrollwheel="on" single_zoom="14"][/wpv-map-render]

I'll be glad to take a closer look if you can provide a link where I can see the map. If I need login credentials, please provide those in the private reply fields here.

#2138169

I should add that on the first map I refer to, some of the cluster markers work OK and others don't.

#2139685
Screen Shot 2021-08-10 at 6.24.25 PM.png

Something is up here, there are duplicate markers placed on these maps in some (but not all) locations. I'm still troubleshooting but I've turned on spiderfy and turned off clustering for now. If you zoom in closely and click an icon, some of them will split apart showing two individual icons at the same location - screenshot attached. I'll have to give you another update tomorrow once I've done some additional testing.

#2140359

I was just running a few more tests in the staging environment and had some bizarre results. I created a new View here:
hidden link

I placed it on a new test page here:
hidden link

Most markers are included more than once, and some markers are included as many as 4 times. That's unusual, for sure. I think the next step is to try to reinstall Types, Views and Maps to see if the problem is a corrupt plugin installation. You can also try activating LiteSpeed and clearing all the caches and transients. If those steps doesn't work, I'll need to create a clone of the site so I can inspect the database and see what could be happening here.

#2140443

Thanks Christian, that does sound bizarre. I did wonder if I somehow had duplicate addresses or posts anywhere, but I don't see any. And with clustering and spiderfy turned off everything looks OK, I have the right number of markers in the right places.

As I recall, there should be no risk in removing and reinstalling Toolset plugins, the data should be untouched?

#2140487

I did wonder if I somehow had duplicate addresses or posts anywhere, but I don't see any
I do not see duplicate addresses or posts, and the text results of the View show none of the same duplication. If there were duplicate posts it seems that the same post titles would appear multiple times in the off-map results. As far as the addresses, I checked the address of one of the duplicate markers, then searched for that address in Toolset > Settings > Maps > Load cached data. Only one entry appears in the cache table.

I tried changing the map and marker IDs thinking that maybe some of the extra markers are being attached to this map from another View, but no luck there. New View, new map IDs, new marker IDs, new page, same problem.

As I recall, there should be no risk in removing and reinstalling Toolset plugins, the data should be untouched?
Correct, all the content you've created will remain untouched in the database. It's not a bad idea to make a backup beforehand though, if you've got a system for automated backups you can trigger a manual one.

#2143279

OK, thanks, Christian. I may just let this issue go for now. Clustering isn't essential to me, I've been testing the large map on various devices and networks, and even without caching turned on, it loads reasonably fast. I'm not sure clustering would make a huge difference. I'll let you know if I change my mind 🙂

#2143297

I understand - though I did not want to imply that I had given up, or that the problem is unsolvable. If you're satisfied as-is we can certainly close out here, but if you'd like to keep digging I will be glad to continue the investigation.