leaflet-geoman
leaflet-geoman copied to clipboard
Area Preservation when dragging polygons.
When dragging polygons to different latitudes, area is not being preserved. Specifically, when a polygon is created in towards the poles and brought towards the equator, its width is not adjusting appropriately. Height is adjusting though.
Steps to reproduce the issue: Can be done on main site https://geoman.io/leaflet-geoman
- Create a circle over a northern country (like the uk)
- Create a polygon over the same circle.
- Drag the circle to the equator.
- Drag the polygon to the same location at the equator.
In theory they should both remain the same size. However they distort in different ways.
Circle and polygon created in north with same shape. Circle and polygon with different shapes after being dragged to the equator.
I don't really have a solution to this but thought I'd offer some findings on the matter.
This is probably due to the curvature of the earth and the way that leaflet handles it's coordinates.
check out the leaflet draw demo
Though you can't reproduce it exactly as polygons aren't draggable. If you draw a circle say over Iceland and a square over the circle:
Then drag them both down to the equator, a similar effect can be seen.
Hmm, interesting. I have had the topic when we fixed this for circles (and I believe they behave correctly currently). The question is if the difference between polygons and circles is correct or not. I COULD imagine this being correct as polygons have dedicated coordinates that are moved while a circle only has a center and a radius and the circle is just... projected... not "real".
But this is purely a guess
@codeofsumit that was my thinking on this.
Kind of 'unexpected expected behaviour'.
#585 goes in the similar direction