Leaflet / Leaflet.draw

Vector drawing and editing plugin for Leaflet
https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html
MIT License
1.97k stars 992 forks source link

documentation request - wrapping maps and invalid Latitudes #546

Open abrin opened 8 years ago

abrin commented 8 years ago

Apologies if this documentation exists (or if this should be in the Leaflet queue instead of the leaflet draw queue), but I didn't find it on the main documentation page. It appears that Leaflet uses Latitudes greater than 180º or less than -180º when a user scrolls past the anti-meridian / Dateline depending on the direction of the scroll. It would be useful to state this explicitly in the documentation. It didn't occur to us that we'd get a Longitude of 225 or -300 from Leaflet.

thanks

loanlaux commented 6 years ago

Bumping into this old issue. I'm having the same problem here.

When drawing a polygon across the anti-meridian, what I would like to get from Leaflet is a multi-polygon whose bounds stay within [0, 180]. However, all I can get is a simple polygon with bounds greater than 180.

This doesn't seem to be mentioned anywhere in the docs.

Is there a way to get Leaflet to return a multi-polygon with bounds within [0, 180] when drawing across the anti-meridian? Is there a plugin that does this? I've seen documentation about this regarding Leaflet "core", but nothing covering user-drawn shapes in Leaflet.Draw.