Title: Map Clusterer
Last modified: December 9, 2019

---

# Map Clusterer

 *  [bklogos](https://wordpress.org/support/users/bklogos/)
 * (@bklogos)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/map-clusterer/)
 * The behaviour of the clusterer appears to be different between initial auto-loading
   geolocation and using search ( using the result of the geolocation in the box).
 * With the resulting zoom level the same:
 * The auto-load placed all the locations in a cluster.
 * The search used the cluster size setting ( 50 ) and correctly showed no clustered
   markers.
 * =======
    Is the auto-loading geolocation using a different cluster size setting,
   than the value in settings page? And if so, where is that value set? Where can
   I change it?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/map-clusterer/#post-12221832)
 * There’s only one settings value that’s used for the cluster markers in general.
 * If you make a search it’s unlikely to start from the exact same place the auto-
   load does, so the results may be different with the markers being clustered together
   or not.
 *  Thread Starter [bklogos](https://wordpress.org/support/users/bklogos/)
 * (@bklogos)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/map-clusterer/#post-12223564)
 * Hi Tijmen, thank you for the quick reply.
 * True the auto-load starts zoomed out, but…
 * The search radius does not change from the initial auto-location to the manual
   search.The underlying map ( grid size ) does not change, the only change is from
   a single cluster from the auto-location result, to the individual markers of 
   the search result.
 * The search itself, uses the results in the box placed there by the auto-location.
 * What appears to happen is that the auto-location marker results are done with
   the map zoomed out, the “start location” marker is placed, the map zooms in to
   the defaulted value, with the cluster now overlaid on top of the “start location”
   marker. The marker results are not updated to reflect the final zoom level, if
   they were the cluster would have been removed at the defined grid setting of 
   50. ( as it is once the manual search is run )
 * It is like there is a step missing in auto-location after the final zoom-in. 
   The zoom-in changes to the grid size are not recalculated.
 * The manual search is already at the zoomed-in level, so the grid setting is applicable.
 * Max Zoom = 8
    Cluster size = 50 Attempt to auto-locate the user: true Auto adjust
   the zoom level to make sure all markers are visible? true Initial zoom level:
   3 Max auto zoom level: 15 Map type: Roadmap Search Radius default 500 km
 *  Thread Starter [bklogos](https://wordpress.org/support/users/bklogos/)
 * (@bklogos)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/map-clusterer/#post-12231869)
 * Hi Tijmen,
 * I’m no coder, though I had a look through your wpsl-gmap.js file, and I did a
   web search for any similar sounding issues with marker clustering.
 * ——–
    [https://github.com/googlemaps/v3-utility-library/issues/469](https://github.com/googlemaps/v3-utility-library/issues/469)“”
   I am calling fitbounds to center the map after marker creation. The issue is 
   the clusters will be initially drawn as if the zoom level were before the fitbounds
   zooms in/out the map view. Zooming manually after will trigger cluster repaint
   and fix the issue. So if the map were zoom 3 initially, and the fitbounds zooms
   to 6, the clustering behaves as if it were still zoom 3.
 * EDIT: Actually, this issue happens even if I don’t use fitbounds and use zoom().””
   ——–
 * The solution seemed to be in that case to catch the even and repaint the cluster.
 * google.maps.event.addListenerOnce(map, ‘idle’, function() {
    markerClusterer.
   repaint(); });
 * I didn’t find markerClusterer.repaint() in your code, maybe if repaint() was 
   placed after fitBounds() in your code.
 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/map-clusterer/#post-12249144)
 * I tried to replicate it, but don’t seem to be able to make it happen. Can you
   share the URL where this happens, and what I should search for?
    -  This reply was modified 6 years, 5 months ago by [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/).
 *  Thread Starter [bklogos](https://wordpress.org/support/users/bklogos/)
 * (@bklogos)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/map-clusterer/#post-12250478)
 * Hi Tijmen,
    Thanks for looking at this again
 * [https://tavat-eyewear.com/store-locator/](https://tavat-eyewear.com/store-locator/)
 * What you initially see would depend on your location, however if you “deny” the
   geolocator access, the default is set to Europe, and it should still have the
   same effect as I see from my geolocation.
 * It will search the default region, return a single cluster of 19, zoom in, and
   then keep the same cluster of 19 even though it as now at zoom level 5.
 * The cluster should have dispersed to 4 clusters at level 4, and at level 5, even
   further disbursement with individual markers & clusters presented.
 * My issue is that the clusterer should be repainted after the final zoom, to show
   the clusterer results at that zoom level.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Map Clusterer’ is closed to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

## Tags

 * [cluster](https://wordpress.org/support/topic-tag/cluster/)
 * [map](https://wordpress.org/support/topic-tag/map/)
 * [Markers](https://wordpress.org/support/topic-tag/markers/)

 * 5 replies
 * 2 participants
 * Last reply from: [bklogos](https://wordpress.org/support/users/bklogos/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/map-clusterer/#post-12250478)
 * Status: not resolved