Editable rectangle

3850
1
Jump to solution
02-13-2015 03:31 AM
ChristopheSCILLIERI
New Contributor II

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.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ChristopheSCILLIERI
New Contributor II

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.

View solution in original post

0 Kudos
1 Reply
ChristopheSCILLIERI
New Contributor II

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.

0 Kudos