[OpenLayers-Users] WFS Ghosts
Gissur Þórhallsson
gissur at loftmyndir.is
Tue Feb 15 12:37:23 EST 2011
Hello there.
I'm editing a vector layer via OpenLayers and I'm having trouble
implementing a Cancel button
I'm using the DrawFeature and ModifyFeature controls and I've been trying to
create a cancel button that utilizes a mix of SelectControl.unselectFeature
and ModifyControl.resetVertices along with Layer.refresh (I'm modifying a
WFS-T layer)
But I for some reason I always end up with the ghosts of my changes on the
map
These ghosts look like genuine features unto themselves - only they don't
show up in the Layer.features array and when I hover over them, the select
control activates on the real feature
The only way to get rid of them is to force a refresh by zooming out or
something akin to that.
I have a running (sort-of) minimized test-case here:
http://212.30.228.18/modifyFeatureGhosts/index.html
Steps to repdroduce:
1) Open the above URL - you should see some polygons - grey fill, blue
stroke.
2) Hover over a polygon - you'll get a small window with single attribute (
don't let the Icelandic scare you)
3) Click a polygon - the attribute window will change offering you a few
options.
4) Click Modify Geometry
5) Drag some points around, create new ones, delete existing ones - just
don't get too carried away.
6) Click Cancel - your changes are still there aren't they?
7) Hover over the same feature again - you will see the original geometry
reverted, but still with the ghost of your changes.
For reference, here is my onClickCancel event:
http://ol.pastebin.com/PnF6w1W5
Also here is the entire test case zipped:
http://212.30.228.18/modifyFeatureGhosts/modifyFeatureGhosts.zip
Kind regards from Iceland,
Gissur Þórhallsson
Loftmyndir ehf.
Laugavegur 13
IS 101 Reykjavík - Iceland
sími (tel): (+354) 540 2500
tölvupóstur (email): gissur at loftmyndir.is
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110215/ecf6bde3/attachment.html
More information about the Users
mailing list