<div class="gmail_quote">Hello there.<div><br></div><div><div>I'm editing a vector layer via OpenLayers and I'm having trouble implementing a Cancel button</div><div>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)</div>
<div><br></div><div>But I for some reason I always end up with the ghosts of my changes on the map</div><div>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</div>
<div><br></div><div>The only way to get rid of them is to force a refresh by zooming out or something akin to that.</div><div><br></div><div>I have a running (sort-of) minimized test-case here: <a href="http://212.30.228.18/modifyFeatureGhosts/index.html" target="_blank">http://212.30.228.18/modifyFeatureGhosts/index.html</a></div>
<div><br></div><div>Steps to repdroduce:</div><div>1) Open the above URL - you should see some polygons - grey fill, blue stroke. </div><div>2) Hover over a polygon - you'll get a small window with single attribute ( don't let the Icelandic scare you)</div>
<div>3) Click a polygon - the attribute window will change offering you a few options.</div><div>4) Click Modify Geometry </div><div>5) Drag some points around, create new ones, delete existing ones - just don't get too carried away.</div>
<div>6) Click Cancel - your changes are still there aren't they?</div><div>7) Hover over the same feature again - you will see the original geometry reverted, but still with the ghost of your changes.</div><div><br></div>
<div>For reference, here is my onClickCancel event:<a href="http://ol.pastebin.com/PnF6w1W5" target="_blank">http://ol.pastebin.com/PnF6w1W5</a></div><div><br></div><div>Also here is the entire test case zipped: <a href="http://212.30.228.18/modifyFeatureGhosts/modifyFeatureGhosts.zip" target="_blank">http://212.30.228.18/modifyFeatureGhosts/modifyFeatureGhosts.zip</a></div>
<div>Kind regards from Iceland, </div><div>Gissur Þórhallsson<br><br>Loftmyndir ehf.<br>Laugavegur 13<br>IS 101 Reykjavík - Iceland<br>sími (tel): (+354) 540 2500<br>tölvupóstur (email): <a href="mailto:gissur@loftmyndir.is" target="_blank">gissur@loftmyndir.is</a><br>
</div></div>
</div><br>