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.
If you cluster an OpenLayers Data Overlay then it doesn't know how to handle the ${attribute} for the label, even when the cluster consists of only one object.
Comments
Comment #1
DjebbZ CreditAttribution: DjebbZ commentedThe OpenLayers style plugin from D6 version needs to be updated to D7 first before this can work. The Drupal and Views sides are properly sending the data to the javascript side. (confirmed with zzolo, here at London DrupalCon).
Comment #2
zzolo CreditAttribution: zzolo commentedThere is currently a branch for porting the Style Plugins. A bigger feat than I expected:
http://drupal.org/node/177400/git-instructions/feature-port-style-plugins
Comment #3
ekes CreditAttribution: ekes commentedClustering features have been fixed in present version. Attribute is set in present version - unless I misunderstand the issue, re-open if so.
Comment #4
Pol@zzolo: Can we delete that branch ?
Comment #5
zzolo CreditAttribution: zzolo commentedYep, go for it.
Comment #7
Exploratus CreditAttribution: Exploratus commentedWhen I activate clusters, my defined attribute for a style renders "undefined". When I turn off clustering, my attribute renders fine. I guess this is still an issue? Basically, I cannot have a custom defined field as an attribute if I want to have clustering enabled.
Comment #8
japo32 CreditAttribution: japo32 commentedI'm using Drupal 7.22, Openlayers 7.x-2.x-dev. The same thing is happening in my site - when I turn off the "Cluster Features" behavior, the attributes render fine. when I turn it on, all the attributes are undefined.
Also, the undefined label renders twice - one as a label, and another as an outline, one on top of the other. So the result is a thick rendering of the letters.
Here's the rendered HTML for the label.
I've attached a screenshot.
Please take note that I made an undefined.png (sun icon) so it doesn't look all broken. :)
Comment #9
Metasequoia CreditAttribution: Metasequoia commentedI experience exact the same problem. This is obviously a bug.
Comment #10
japo32 CreditAttribution: japo32 commentedHi guys, I think I may have fixed this bug. Plus I've added a new feature where you can set the clusters to show the top priority feature instead of the default circles with numbers. But you need to create a new field for your view for the sorting order.
I also fixed the popup to accommodate the new top priority feature.
Please review. :)
Comment #11
Metasequoia CreditAttribution: Metasequoia commentedwow, looks good! currently I have no time to review the patch and I am furthermore a total newby to patching modules. but I will definitely try it next week and give you feedback.
Comment #12
Exploratus CreditAttribution: Exploratus commentedBig patch! I'll do some testing and report back.
Comment #13
japo32 CreditAttribution: japo32 commentedI'm a newbie as well. This is my first patch submitted. And I have to say, seeing that it passed the simpletest makes me really happy hehe. :)
Comment #14
PolHello there,
Sorry for the lack of presence these days, I'm in holidays, so, I take it easy :)
Here's a quick review for your patch...
Remove console.log().
Remove trailing spaces.
Remove trailing spaces.
Comment #15
japo32 CreditAttribution: japo32 commentedI cleaned all the console.log() and trailing/unnecessary spaces.
Comment #16
PolThanks for your speed !
But sorry to be picky, but there are still some trailing spaces left all over the patch...
Here some examples...
Here
Here
Here
Here
Comment #17
japo32 CreditAttribution: japo32 commentedIt's ok Pol. Is there a way to check for the EOL spaces automatically? like a cleanup plugin? I'm using sublime2 to edit.
Comment #18
PolI don't use Sublime, I use PHPStorm which remove them automatically. Maybe there's an option in Sublime ?
Comment #19
japo32 CreditAttribution: japo32 commentedI used the JS Format plugin in Sublime. :) Pls check if that did the trick.
Comment #20
jetsonjohn CreditAttribution: jetsonjohn commentedCluster number is not displaying when I use this patch
Comment #21
jetsonjohn CreditAttribution: jetsonjohn commentedCluster number is displayed whwn I changed the
sites/all/modules/openlayers/plugins/behaviors/openlayers_behavior_cluster.js
at line 45 a little bitif (options.display_cluster_numbers === 'numbered') {
to
if (options.display_cluster_numbers === 'clusters'){
now the count is showing in the cluster marker in the map.
Comment #22
japo32 CreditAttribution: japo32 commentedjetsonjohn,
The patch adds 3 options to the display as illustrated in comment 10. You can check the behavior settings of your layer.
What you did in comment 21 was change the settings manually. :) the behavior setting "Cluster Variant" in the Clusters section does the same thing. :)
Comment #23
pmusaraj CreditAttribution: pmusaraj commentedI created a simplified patch from the above, and my patch only fixes the "undefined" graphic issue when using clustering. Let me know if this works.
Comment #24
chaloalvarezj CreditAttribution: chaloalvarezj commentedI had the problem of ${attributes} not been applied in styles when clustering was enabled.
The patch in #23 seems to have solved it. So far my attributes are been passed!
Thank you!
Comment #25
citkane CreditAttribution: citkane commentedThanks japo32 and pmusaraj, patch @ #23 worked for me. Does anybody know if this will be included in main Openlayers module release?
Comment #26
skyredwangComment #27
SidneyGijzen CreditAttribution: SidneyGijzen commentedConfirming that the patch from #23 works with OpenLayers 7.x-2.0-beta11. Thanks japo32 and pmusaraj!
Comment #28
basvredelingCleaning up the issue queue for #2670484: Stable 7.x-2.0 release.
This needs to be evaluated for inclusion in 7.x-2.0 stable