OpenLayers.Control.ModifyFeature will not delete vertex ...

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenLayers.Control.ModifyFeature will not delete vertex ...

John Harris
Hi,

I am having a problem passing a feature (LineString) which I have selected with an OpenLayers.Control.SelectFeature control to an OpenLayers.Control.ModifyFeature control.

I find that the Modify control appears to accept the feature (its vertices all 'lite up') and the vertices can each be dragged around etc. But the vertices can not be deleted. If I selected the feature directly by clicking over it after activating the Modify control then it works OK - the vertices can each be deleted. But after selecting a feature by way of a SelectFeature control and then using the Modify control's selectFeature( ) method to select this same feature the problem occurs - viz I cannot delete vertices.

Any advice would be appreciated - is the SelectFeature control doing something to this feature which I should know about ?

Thanks

John
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers.Control.ModifyFeature will not delete vertex ...

Andreas Hocevar-2
This sounds very strange. Did you configure the ModifyFeature control with {standalone: true}? Also, which version of OpenLayers are you using? The ModifyFeature control has recently been fixed and improved in many ways, so you should be using 2.13.1.

Andreas.


On Wed, Jul 31, 2013 at 7:04 PM, John Harris <[hidden email]> wrote:
Hi,

I am having a problem passing a feature (LineString) which I have selected
with an OpenLayers.Control.SelectFeature control to an
OpenLayers.Control.ModifyFeature control.

I find that the Modify control appears to accept the feature (its vertices
all 'lite up') and the vertices can each be dragged around etc. But the
vertices can not be deleted. If I selected the feature directly by clicking
over it after activating the Modify control then it works OK - the vertices
can each be deleted. But after selecting a feature by way of a SelectFeature
control and then using the Modify control's selectFeature( ) method to
select this same feature the problem occurs - viz I cannot delete vertices.

Any advice would be appreciated - is the SelectFeature control doing
something to this feature which I should know about ?

Thanks

John



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/OpenLayers-Control-ModifyFeature-will-not-delete-vertex-tp5069993.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers.Control.ModifyFeature will not delete vertex ...

John Harris
Andreas,

Thank you for your reply !  First can you tell me how can I tell which version of OpenLayers I am using ? In my script I use <script src="http://openlayers.org/api/OpenLayers.js"></script>  and assume that this will access the latest version ?

Secondly, I think I am right that if the ModifyFeature control is configured with {standalone: true} then I can select a feature into this control by using its SelectFeature method but not by clicking over the feature on the map ?  But once a feature is selected by either means does the control see any difference - ie. does it have any recollection of how the feature was selected ?

Thanks and regards

John
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers.Control.ModifyFeature will not delete vertex ...

Andreas Hocevar-2
To see your OpenLayers version, type

OpenLayers.VERSION_NUMBER

in your JavaScript console.

The ModifyFeature control does not know how the feature was selected once it is selected.

Andreas.


On Tue, Aug 6, 2013 at 2:59 AM, John Harris <[hidden email]> wrote:
Andreas,

Thank you for your reply !  First can you tell me how can I tell which
version of OpenLayers I am using ? In my script I use   and assume that this
will access the latest version ?

Secondly, I think I am right that if the ModifyFeature control is configured
with {standalone: true} then I can select a feature into this control by
using its SelectFeature method but not by clicking over the feature on the
map ?  But once a feature is selected by either means does the control see
any difference - ie. does it have any recollection of how the feature was
selected ?

Thanks and regards

John



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/OpenLayers-Control-ModifyFeature-will-not-delete-vertex-tp5069993p5070938.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers.Control.ModifyFeature will not delete vertex ...

John Harris
Andreas,

Thank you for this ! My version number is "Release 2.13.1" which is what I expected. I have a further diagnostic on my problem - deleting a vertex from a LineString using a Control.ModifyFeature control. I have found that if a 'virtual vertex' is dragged into position to create a new vertex then this new vertex will delete on pressing the Del key. It is only the original vertices that will not delete.

Can I reinstate that this issue arises when the feature (LineString) is first selected by a Control.SelectFeature control and then passed to the ModifyControl by way of the latter's selectFeature method.

I would appreciate any advice !

Thanks and regards

John