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.

CommentFileSizeAuthor
Capture.PNG158.63 KBelaman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

elaman’s picture

Version: 7.x-2.0-beta7 » 7.x-2.x-dev

Issue still persist in development branch.

elaman’s picture

Assigned: Unassigned » elaman

Apparently 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.

elaman’s picture

Status: Active » Closed (works as designed)

It is me being stupid. Just set clustering threshold to 2 in settings and it will solve an issue.