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.
The attached patch allows you to override the available layer switcher properties (http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/Ope...) through openlayers behaviors, E.g.,
/**
* Implement hook_openlayers_map_preprocess_alter
*/
function map_openlayers_map_preprocess_alter(&$map = array()) {
// turn off rounedCorner on the layer switcher
$map['behaviors']['openlayers_behavior_layerswitcher']['roundedCorner'] = FALSE;
}
I believe this was the module author's intention all along, but "ascending" was the only available property. This adds roundedCorner and roundedCornerColor.
Comment | File | Size | Author |
---|---|---|---|
#3 | openlayers-layerswitcher-behavior.patch | 3 KB | levelos |
openlayers-layerswitcher-behavior.patch | 1.88 KB | levelos | |
Comments
Comment #2
tmcw CreditAttribution: tmcw commentedCould you add the ability to modify these properties without using a preprocess, by adding them to the behavior's options form?
Comment #3
levelos CreditAttribution: levelos commentedProbably a good idea. Attached. BTW - I tried unsuccessfully to make the roundedCornerColor field dependent on the roundedCorner checkbox with no success. Maybe you want to give it a go. Not essential.
Comment #5
strk CreditAttribution: strk commentedThe patch is good to me.
Only, it sounds weird that you can set the rounded corners color but not the background color.
I guess the latter is only controllable via .css, isn't corners color also controllable so ?
Anyway, I committed it: http://drupal.org/cvs?commit=432176
Comment #6
levelos CreditAttribution: levelos commented@strk, I believe the background is always transparent. I was just going from the available layer switcher properties, http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/Ope.... Thanks for the quick commit.