Hello
I have an OpenStreetMapLayer and a VectorLayer with some PointVectors in it. I would like to remove the selected PointVector. It gets removed but afterwards the selection seems not to work. What happens is the following:
- My VectorLayer is in MODIFY drawing mode.
- I click on a PointVector on the map. As a result, the PointVector gets selected.
- I remove the selected PointVector from the VectorLayer (by the click of a Button):
public void delete(PointVector point) {
myVectorLayer.removeComponent(point);
}
- The PointVector disappears from the map.
- Then when I click on another PointVector it is not selected (and I don’t receive a VectorSelectedEvent on the server side). No clicks result in a selection anymore.
- However, I can still drag PointVectors around. If I drag PointVector “A” and then click somewhere on the map, I get no VectorModifiedEvent. However, if I click another PointVector (“B”) then (a) I get a VectorModifiedEvent for “A”, (b) then a VectorSelectedEvent for “A”, (c) a VectorUnSelectedEvent for “A” and then a VectorSelectedEvent for “B” and “B” gets into the selected state.
Basically, I would like to get your help with the following questions:
Is Vectorlayer.removeComponent(…) the way to delete a PointVector?
If so then what else do I need to do not to have the above described issues?
If not, then what is the preferred way of removing a PointVector?
Thanks in advance,
Richie.