Leaflet.Path.Transform icon indicating copy to clipboard operation
Leaflet.Path.Transform copied to clipboard

missing method to set rotation angle externally

Open alexandervlpl opened this issue 7 years ago • 4 comments

It would be very useful to have a method like polygon.transform.set_angle() so that polygons can be rotated externally, without user interaction.

Thanks for the great plugin! :+1:

alexandervlpl avatar May 18 '18 12:05 alexandervlpl

@alexandervlpl I had the same problem. As I have just found, you can rotate a polygon externally with polygon.transform.transform(angle);

Not very explicit, but it works

vnosikov avatar Jan 23 '20 12:01 vnosikov

Hi! I'm also interested in a method like polygon.transform.set_angle(), which it should be an absolute angle. Indeed the @vnosikov proposed a solution using the transform.transform(angle), but I figured out that the angle should be relative, that is, I didn't find any way to set an absolute angle.

betomaki avatar Oct 21 '21 11:10 betomaki

what do you mean by "absolute"?

w8r avatar Oct 21 '21 11:10 w8r

Hi w8r! "Absolute" I mean, if I set the angle to 45deg, I expected to have everything rotated 45deg. However, using the suggestion of @vnosikov, if I call it a number of times, it increments the angle.

Maybe I'm failing to check the documentation, but is there any way to access the angle in transform? Something like a angle property...

betomaki avatar Oct 21 '21 12:10 betomaki