The OL style called "Default style" is not the style applied by default.
In other words, the style defined at admin/structure/openlayers/styles/list/default/edit is not applied to new layers unless explicitly set to override the style applied by default.

For example, "Default style" has fill color #888888 and stroke color #222222.
However, when I create a new layer without setting any particular style, the style applied by default has fill color #ee9900 and stroke color #ee9900.

As a corollary, there's no way to globally adjust the style OpenLayers applies by default.

So, 2 parts to this feature request:
1. It's very confusing to have a style called "Default style" which is not actually the style applied by default.
It should be renamed to something like "Basic style" to address this confusion.

2. OL should provide some UI to adjust the style which is automatically applied.

Please let me know if I'm missing something.
Apologies if this issue has been filed already.
It's quite difficult to search for such generic terms in the queue.

If this seems like a reasonable request, I am willing to work on the patch to provide this feature.
Thanks in advance.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pol’s picture

Hi Aaron,

Looks like it's a bug indeed and it should be fixed.

AaronBauman’s picture

Title: Provide a mechanism to override OpenLayers' default style. Rename "Default style". » Apply "Default style" by default
Assigned: Unassigned » AaronBauman
Category: feature » bug

Just so we're on the same page, the bug is that the "Default style" is not applied by default?
I will take a crack at this.

AaronBauman’s picture

Status: Needs review » Active
FileSize
1.68 KB

OK, here's the patch.
Applies the styles selected under "Default Styles" fieldset when "<use default style>" is selected in the Overlay Layers table under "Layers and Styles" fieldset.

Note: this means any existing map implementations which use OpenLayers' (the library) defaults will now be updated to use OpenLayers' (the module) defaults. (E.g. the markers which were #ee9900 will become #222222).
To me this doesn't seem like too big a deal, since technically these maps had style settings that were broken / ignored, and this patch fixes them.

AaronBauman’s picture

Status: Active » Needs review
Pol’s picture

Status: Active » Fixed

Make sense ! Thank you very much !

Status: Fixed » Closed (fixed)

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