Closed igorshmukler closed 11 months ago
I tried to reproduce your problem without success. Please create a demo: https://jsfiddle.net/nzmb18es/
I just spent the last few days dealing with a similar issue.
Devs can correct me if I'm wrong but in order to show rotation vertices, geoman will throttle global rotation mode if you add a rotatable item to the map while globalRotateModeEnabled() is true. I recently was working with this in a similar situation where I was adding my own temp polygons to be able to rotate markers.
I know it's a year later but I hope this can help someone that might find themselves in a similar sitaution. In your code it looks like the only culprit of the rotation mode throttle I think could be this line that._transformationRuler.addTo(that._map);
If transformationRuler is a polygon/polyline then that is likely your issue.
@matthewtboyle thank you, I found now the problem. I opened a new issue to have a better description #1412
Hello,
I am trying to integrate 'leaflet-editable-marker' with 'leaflet-geoman'. I used to have a custom rotate button, but since the modern geoman supports rotate, I decided to integrate my code. Build the below to handle this:
Please excuse the temporary code. I did discover that for no apparent reason, geoman throws a bunch of events when there is no change for the rotate.
I added console.log to both editable marker and leaflet package sources, and it prints the following:
These
pm:globalrotatemodetoggled
state changes are triggered by the below:Specifically, the problem occurs while executing
layer.activateTransformation()
which is a method from the "editable marker" package. I don't know geoman well, so I don't see what could be triggering therotate
status change. To make it easier, below is the code for activateTransformation.Why is the event emitted when I understand it should not be? What could flip the status back and forth? Is this a geoman bug, or am I doing something wrong? I am happy to change whatever is necessary in my code and/or in editable marker. I just don't understand what causes the problem, so I am at loss as to what has to be adjusted.