i was looking for a way to add the cluster information to data provided by leaflet_views.
leaflet prepares the data gathered from views using leaflet_process_geofield before it sends it further to be processed in leaflet.drupal.js.
the attached patch adds a hook_leaflet_views_alter_points_data which i currently use in a working draft of my geocluster module.
in order to visualize clusters as numbered markers, i currently rely on a adapting Drupal.leaflet.create_point.
i'd be happy to hear your thoughts on my approach to clustering and the related leaflet integration.
also see #1547610: Plan server-side geo clustering for drupal 7
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | leaflet_views.api_.php-alter_hook-1796422.patch | 651 bytes | aaronbauman |
| #5 | leaflet_views_alter_points_data_5.patch | 1.33 KB | dasjo |
| #3 | leaflet_views_alter_points_data_3.patch | 0 bytes | dasjo |
| leaflet_views_alter_points_data.patch | 1.06 KB | dasjo |
Comments
Comment #1
dasjohere's a screenshot of how it looks like:
Comment #2
pvhee commentedNice work dasjo, I'd like to add this to the module but could you also provide a patch for the API docs?
Comment #3
dasjohere's an updated patch that uses drupal_alter and provides API docs.
i'm not in a hurry though, as for geocluster i'm relying mostly on views_geojson with its own, similar hook #1799870: Add hook views_geojson_feature_alter
Comment #4
rdeboerThanks for the patch. Great idea.
But Patch broken: 0 bytes.
Comment #5
dasjoups, here it is :)
Comment #6
rdeboerThanks! -- Rik
Comment #7
pvhee commentedThanks dasjo, this looks good, and I've committed it.
Comment #9
aaronbaumanThe API function is leaflet_views_alter_points_data_alter(), not leaflet_views_alter_points_data().
Comment #10
rdeboerPatch applied with attribution.
Thanks Aaron!
Rik