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.
Before I file this as a bug report, I'll check to see whether I'm doing something wrong.
When I apply a style to a specific map feature via hook_openlayers_map_alter, my style is not represented in the rendered map.
For example:
function MYMODULE_openlayers_map_alter(&$map) {
$map['layers']['default_map_openlayers_1']['features'][0]['style']['pointRadius'] = 25;
}
In this case, the feature is rendered with the default pointRadius, 6.
Is there a different way I should be doing this?
For what purpose does this alter hook exist otherwise?
Comment | File | Size | Author |
---|---|---|---|
#4 | cluster_behavior-2071109-4.patch | 22.04 KB | basvredeling |
Comments
Comment #1
AaronBaumanI've narrowed down the problem to cluster behavior.
openlayers_behavior_cluster.js defines a styleMap object, which takes precedence over other styles, including those defined directly on a feature.
cluster behavior should reconcile existing style definitions, rather than overriding them completely.
Comment #2
johnhanley CreditAttribution: johnhanley commentedI don't mean to hijack this issue, but on a related note the cluster text color should not be hard-coded in openlayers_behavior_cluster.js, but instead should be configurable through the interface along with the cluster color settings.
Comment #3
Pol@bacteriaman,
Please, could you provide a patch to customize the text-color ?
Thanks!
Comment #4
basvredelingThis patch does quite a lot and needs to be tested thoroughly.
Enjoy!
Comment #5
basvredeling@bacteriaman, my patch solves your issue. Feel free to review it.
Comment #6
johnhanley CreditAttribution: johnhanley commented@basvredeling,
Sorry, I got distracted with other tasks after my original post and never followed up on this issue.
I'm anxious to take your patch for a test drive when time permits. Thanks!
John (aka. bacteriaman)
Comment #7
basvredelingReapplied to latest dev release. Functionality still works fine.
Comment #8
basvredelingCleaning up the issue queue for #2670484: Stable 7.x-2.0 release.
This is a pretty long, but quite simple patch. Please review.