Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Having trouble in using clustering along with GeoJSON. Here is the setup:
GeoJSON I'm using Views GeoJSON module to provide data to Openlayers map.
externalGraphics I have added image field (field_icon) to views and used Imagefield URL Formatter as image output. Than created new Openlayers Style with externalGraphics = $(field_icon)
Clustering Enabled clustering behavior in Openlayers map settings.
Result:
Feature externalGraphic attributes are pointing to http://sitename/undefined
Everything is working as expected when clustering is not enabled.
Comment | File | Size | Author |
---|
Comments
Comment #1
elamanIssue still persist in development branch.
Comment #2
elamanApparently when clustering is enabled, all features are moved into a sub-array called "feature.cluster" leaving "feature.attributes" property of the feature empty. It is the case even if feature is not cluster itself.
So, when style rule find features that are not clusters and it tries to get an attributes of the feature, but it finds nothing, because it is moved into the cluster sub-array.
I'll try to fix it and make a patch.
Comment #3
elamanIt is me being stupid. Just set clustering threshold to 2 in settings and it will solve an issue.