Ticket #630 (closed feature: worksforme)

Opened 6 years ago

Last modified 6 years ago

vector features should get default style

Reported by: tschaub Owned by: tschaub
Priority: minor Milestone: 2.4 Release
Component: Feature.Vector Version:
Keywords: Cc:
State:

Description

creating a feature with

f = new OpenLayers.Feature.Vector(geometry);

should give you a feature with the default style.

Attachments

style.patch Download (478 bytes) - added by tschaub 6 years ago.
give new vector features default style

Change History

Changed 6 years ago by tschaub

give new vector features default style

  Changed 6 years ago by tschaub

ok, that was a hasty patch - I see that layer.addFeature expects features to have null style - have to think about that...

  Changed 6 years ago by sderle

yeah, this conflicts with r2949, which was applied to close #543

which feature do we want more? or can we have both?

follow-up: ↓ 4   Changed 6 years ago by crschmidt

I don't think we need feature to have a default style. Do we? It doesn't matter what a feature looks like until we draw it -- the user can always set it explicitly if they care, no?

in reply to: ↑ 3   Changed 6 years ago by sderle

Replying to crschmidt:

I don't think we need feature to have a default style. Do we? It doesn't matter what a feature looks like until we draw it -- the user can always set it explicitly if they care, no?

+1

follow-up: ↓ 6   Changed 6 years ago by sderle

probably the way to fix this is for layers to have a default style if none is assigned, and for it to be used on a feature when the feature is added and no style is assigned to it either

in reply to: ↑ 5 ; follow-up: ↓ 7   Changed 6 years ago by crschmidt

Replying to sderle:

probably the way to fix this is for layers to have a default style if none is assigned, and for it to be used on a feature when the feature is added and no style is assigned to it either

This is the way that it works, essentially. If a feature is added to a layer, it:

  • Checks if feature has a style. If it doesn't:
  • Checks if layer has a style. If it doesn't:
  • falls back to feature.vector.style.default

in reply to: ↑ 6   Changed 6 years ago by sderle

  • status changed from new to closed
  • resolution set to worksforme

Replying to crschmidt:

This is the way that it works, essentially. If a feature is added to a layer, it: * Checks if feature has a style. If it doesn't: * Checks if layer has a style. If it doesn't: * falls back to feature.vector.style.default

if that's the case, then I'm going to close this ticket as worksforme. sorry, Tim! hope that's OK

Note: See TracTickets for help on using tickets.