Leaflet Draw - Drawn shape resizes when center is moved

227 views
Skip to first unread message

Shiva Sai

unread,
Aug 30, 2021, 3:12:13 AM8/30/21
to Leaflet
Hi Team,

When we edit the shapes drawn by using leaflet draw and drag the center of the shape to a different position, the size keeps changing as we drag. For circle, the radius shrinks when we drag south and increases when we drag north. 
For circle and rectangle as well, the boundaries become narrow as drag south and increase as we drag north.


Edit Mode Image: Image of circle in edit mode. The radius depicted is the actual radius drawn by the user.

Edit Mode Image.JPG : When the center is dragged, the radius is altered.
Dragged Image.JPG

 Request your help in fixing this issue.

Thanks & Regards,
Shiva.

Edwin Corrigan

unread,
Aug 30, 2021, 6:06:57 AM8/30/21
to leafl...@googlegroups.com

Hi Shiva, 

I think this is related to thEPSG:3857 projection that leaflet uses by default. In the example below, the radius of both circles are the same, but one is at the equator and the other is near the pole. What this means is that the circle is covering the same area (in km^2 for example) but it looks different because of how the projection represents the 3d world in 2d form. I find a good way to visualise this is to mess around with this site - https://thetruesize.com/. Here you can drag country boundaries to compare how large countries would appear on the map if they were located closer or further away from the equator.

image.png

Also looking into how thEPSG:3857 projection is made would also help to get a better understanding. 

Best Regards,
Edwin

--

---
You received this message because you are subscribed to the Google Groups "Leaflet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-js+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leaflet-js/a02b38ac-357f-4dc1-905c-c700dea53eaen%40googlegroups.com.


Shiva Sai

unread,
Aug 30, 2021, 6:29:45 AM8/30/21
to Leaflet
Hi Edwin,

Thank you for the response. This helps.

Thanks & Regards,
Shiva.

Reply all
Reply to author
Forward
0 new messages