Hi All,
Is there a way to edit a graphic rectangle the same way it is possible for polygons, using Edit class ?
Instead of a rectangle I use graphic polygons and I can move 4 points around. OK.
But I cant get to have it constrained to a simple rectangle at moving time, or even at the end of move.
In a "vertex-move" event I tried to retrieve transformations to keep my polygon a rectangle but I failed in doing this because transformation from pixels (ev.transform.dx, ev.transform.dy) to map doesnt give a good result.
Any idea ?
Regards.
Chris.
Solved! Go to Solution.
Ok I got it :
And my 4 vertices polygons must be edited with a combinaison like this one :
edToolbar.activate( Edit.SCALE | Edit.MOVE , ev.graphic, {"allowAddVertices":false, "allowDeleteVertices":false} );
In this way editions preserves rectangles.
Ok I got it :
And my 4 vertices polygons must be edited with a combinaison like this one :
edToolbar.activate( Edit.SCALE | Edit.MOVE , ev.graphic, {"allowAddVertices":false, "allowDeleteVertices":false} );
In this way editions preserves rectangles.