[OpenLayers-Users] Adding a new feature with different graphics
bluecarto at gmail.com
Sat Dec 13 08:20:48 EST 2008
If I'm correct, what you want is to be able to distinguish vector
features by their state eg. update, insert, delete, unknown. The
vector features drawn by user and not yet committed to server would be
of insert state.
Currently, there's already a "state" property for the Vector.Feature
What you need is :
- to set that state to "OpenLayers.State.INSERT" when the user draws
a new feature, you can easily do this with events at the layer's level
- to have different styles for the different states. 
On Fri, Dec 12, 2008 at 10:44 PM, Yves Moisan <yves.moisan at boreal-is.com> wrote:
> Hi All,
> I'm playing with something similar to
> http://openlayers.org/dev/examples/vector-formats.html and I was
> wondering what the approach is if I want to allow users to add e.g.
> points on an existing layer.vector object but with a different symbol.
> The idea is that I would like objects updated to an OL vector layer but
> not yet committed back to the server to show up in a different symbol
> than the rest of the features of the layer.
> One option I thought was to use an independent feature.vector object and
> then call the features it contains when committing to the layer.vector I
> want to update. After committing, I would erase the feature.vector.
> Does that make sense ?
> Users mailing list
> Users at openlayers.org
More information about the Users