Postponed (maintainer needs more info)
Project:
Leaflet Markercluster
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Mar 2013 at 14:33 UTC
Updated:
8 Feb 2016 at 10:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
steffenrI just read through the issues on the github page - seems to be complicated issue - maybe some has tried it before and found a working solution..
I'm using leaflet_views_data to build up my map and its layers.
https://github.com/Leaflet/Leaflet.markercluster/issues/13
SteffenR
Comment #2
rdeboerComment #3
steffenrMaybe i just found a working solution provided in the comments at github.
http://jsfiddle.net/pvwKJ/4/
Unfortunately i don't have the time to integrate these changes into the module - i hope to get it fixed in the next week and provide a patch in here..
SteffenR
Comment #4
davidhk commentedThe issue 13 mentioned above, https://github.com/Leaflet/Leaflet.markercluster/issues/13, has been updated to say that support for clustering in the layer switcher is now supported by sub-plugins.
If we load the sub-plugin in leaflet.featuregroup.subgroup-src.js, then with edits to 4 lines of leaflet_markercluster.drupal.js, we can add clustering support to groups of points. (Modified copy of leaflet_markercluster.drupal.js attached, see lines 122-3, 145, 155.)
The reason I'd like this support is to have the markers show as a layer in the layer switcher that the user can toggle on & off. So if instead of passing an array of points, $points, to leaflet_render_map(), I create a group and pass that in I get the desired behaviour. The group is simple to make:
You can see the result if you visit http://gwulo.com/map-of-places and toggle the 'Markers' layer.
Would this be a useful addition to the module?