When you use module leaflet_markercluster and default map settings all works perfect.
But when you want override default map settings(as example in view), in this case zoom level, geoclusteting doesn't works correct. See screenshots.
Default zoom
Custom zoom

When you set custom zoom level, function leaflet_apply_map_settings() overrides default settings for map. After that you see incorrect clusters.
Bug

That happens because max/min zoom level in hook_leaflet_map_info() is integer, but in leaflet_apply_map_settings() you using strval() and cast type to string, but for correct work zoom should be integer.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sanchiz’s picture

Initial patch.

sanchiz’s picture

Status: Active » Needs review
sanchiz’s picture

Issue summary: View changes
pfournier’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#2378465: Same Address Cluster

Got the same problem, found the same fix.

dadderley’s picture

Thank you sanchiz.
The patch works brilliantly. Nodes with the same address display in the spidered fashion as they should.

spidered markers

  • RdeBoer committed 0e6e884 on 7.x-1.x authored by sanchiz
    Issue #2366987 by sanchiz: Leaflet, markercluster and zoom levels
    
RdeBoer’s picture

Title: Leaflet, markercluster and zoom levels » Leaflet + Leaflet Markercluster and zoom levels
Assigned: Unassigned » RdeBoer
Status: Reviewed & tested by the community » Fixed

Committed.

Thanks so much Sanchiz.

Available now in 7.x-1.x-dev or in in 7.x-1.2 and later once released.

Rik

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.