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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, openlayers-layerswitcher-behavior.patch, failed testing.

tmcw’s picture

Could you add the ability to modify these properties without using a preprocess, by adding them to the behavior's options form?

levelos’s picture

Status: Needs work » Needs review
FileSize
3 KB

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

Status: Needs review » Needs work

The last submitted patch, openlayers-layerswitcher-behavior.patch, failed testing.

strk’s picture

Status: Needs work » Fixed

The 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

levelos’s picture

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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.