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.
For some reason, the feature.cluster property is not defined when the cluster "threshold" option is used. This makes the zoom to cluster code error out with the following error as the right checks aren't made:
Uncaught TypeError: Cannot read property 'length' of undefined
Reproducible steps:
1) Create a map with the latest --dev version of openlayers
2) Enable the Cluster features behaviour and set a Distance and threshold
3) Enable Popup for features behaviour, tick Zoom to cluster (Not zoom to point).
4) Attempt to click a point for the popup.
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#3 | openlayers-cluster-threshold-fix-3.patch | 1.32 KB | acbramley |
#1 | openlayers-cluster-threshold-fix-2.patch | 1.47 KB | acbramley |
openlayers-cluster-threshold-fix-1.patch | 846 bytes | acbramley | |
Comments
Comment #1
acbramley CreditAttribution: acbramley commentedMuch better patch. There's also bigger issues with this functionality that I have discovered, I will raise this as a separate issue though.
Comment #3
acbramley CreditAttribution: acbramley commentedWoops
Comment #4
chegor CreditAttribution: chegor commented#3: openlayers-cluster-threshold-fix-3.patch queued for re-testing.
Comment #5
zmove CreditAttribution: zmove commentedI confirm the issue and I confirm that the fix works.
Comment #6
PolCommitted & pushed ! Thanks for your patch and testing all !