[OpenLayers-Users] Understanding the Feature Life-Cycle

wls wls at wwco.com
Tue May 17 11:00:12 EDT 2011


I'm trying to grok the more subtle nuances of the OpenLayers life cycle for
features and how they get drawn to the map under the hood.

I vaguely recall in reading in passing that there's a temporary "sketch"
layer that shapes are drawn to.  Then when the action is completed, it gets
'copied' to the desired layer.  I've also seen this referred to as an "Edit
Layer," but I'm not sure how to use it, if there is indeed an 'it' to use.

I'm trying to learn more about this because I'd like to fiddle around with
the feature's attributes before and after it's drawn, in an effort to work
out some complex styling.

Bolo was kind enough to email me a solution which involves using the
preFeatureInsert option on a Vector layer.  While this looks like it'd solve
my prior issue, I find myself stuck in a darker corner of OpenLayer's
documentation.

When I look at OpenLayers drawing examples, they add to the map a
DrawFeature control that has a layer specified in its constructor. This
appears to be the final destination layer where the drawn feature goes.

However, the example below seems to imply there's an edit layer, which is
different than my destination layer.  This would make sense, because I don't
always want to invoke preFeatureInsert with behavior, only when drawing.

http://tinyurl.com/6ana5ks

Can anyone enlighten me to what I'm misunderstanding?

Thanks,
Walt Stoneburner

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Understanding-the-Feature-Life-Cycle-tp6373427p6373427.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list