Skip Navigation

[Escalated to Compatibility team] cluster grid size doesn’t do anything

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.

This topic contains 6 replies, has 1 voice.

Last updated by Christopher Amirian 1 week, 5 days ago.

Assisted by: Christopher Amirian.

Author
Posts
#2816462

Tell us what you are trying to do?
Change the clustering of map icons so they can be a little closer together before they cluster

Is there any documentation that you are following?
I couldn't find much about this parameter here in the documentation but Google Maps API docs say grid size should control how many pixels between icons before they cluster. I tried changing the cluster_grid_size value in the maps shortcode to various numbers but I got the same result no matter what value I tried from 10 to 50.

Is there a similar example that we can see?
An example of the map I'd like to change is: hidden link
If you zoom in 1 level you'll see that with such small markers we don't really need clustering at the default zoom level for the 3 icons in the cluster.

What is the link to your site?
hidden link

#2816507

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Welcome to Toolset support. Toolset Maps exposes Google’s “gridSize” parameter through the shortcode attribute cluster_grid_size.

You’ll find it in the official reference for [wpv-map-render] – section Arguments › cluster_grid_size:

"cluster_grid_size (pixels) – “When cluster is on, this sets the minimum distance in pixels between two markers to join them into the same cluster.”
Default: 60 px"

So lowering the value should delay clustering:

https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/

Alternatively, you can use JavaScript to control the value:

jQuery( document ).ready( function() {
  WPViews.view_addon_maps.set_cluster_options(
      { gridSize: 25 },   // any MarkerClusterer option
      'property-map'      // your map_id
  );
});

Thanks.

#2816830

I tried changing the grid size to 20, 50, 10, and 60 and it had no apparent effect on whether the icons get clustered.

#2816844

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Would you please create a simple version of the map on the installation below, which is a clean installation of WordPress and Toolset plugins?

hidden link

That way, replication of the issue can be reported to the development team for further investigation.

Thanks.

#2817001

Sure. Have a look at: hidden link
Note that no matter what you set the cluster grid size to, the clusters are the same at default zoom. Also, cluster-min-size is set to 3 but there are clusters of 2 all over the map.

#2817091

Christopher Amirian
Supporter

Languages: English (English )

Thank you. I asked the second tier support to take a look into this.

It may take time, thank you for your patience.

#2817306

Christopher Amirian
Supporter

Languages: English (English )

Hi,

I have an answer from the second-tier support. The bug is confirmed and escalated to our development team.

There is no estimation for a fix. But if it is fixed on the upcoming version, I will inform.

Thanks.