I'm new to OpenLayers, and I am developing a basic editor using it. I can place different kind of icons (points) or paths (lines).
An "edit" tool is required. It is supposed to allow you to modify the line path, and move the icons position. However, this is where Im facing problems... to move a point DragFeature must be used, and to edit a line ModifyFeature should be the one.
In this approach, both controls have the same tool, and I am not being able to modify a line or drag a point with the same tool. What I tried, was to use the select control instead. Once a feature is selected, according to its type, I can swap to the appropriate control (drag or modify). However, this technique is far for from perfect, since then, two clicks are required in the feature to start dragging it. The first click, is used by the select feature to capture the event and activate the DragFeature control, and the second one is to start dragging.
I would like to be able to drag a feature with one single click, and be able to edit a line with one single click.
¿Can anyone please help me? Thank you guys