Closed
Description
opened on Apr 9, 2014
Currently in polyline.js we have a bunch of TODOs around rings
https://github.com/Leaflet/Leaflet/blob/master/src/layer/vector/Polyline.js#L20
And we have a weirdness with polygon creation that causes issues with leaflet.draw:
Create a polygon with new L.Polygon -> _latlngs is flat [ latLng, latLng, latLng ]
Create a polygon from GeoJson -> _latlngs is nested [ [ latLng, latLng, latLng ] ]
What are your thoughts on the Polyline/Polygon API?
We could change it so internally polygons are always nested and polylines never.
Then expand the api like:
addLatLng: function (latlng, index)
With index defaulting to 0.
By putting the index parameter second, people not using rings won't need to worry.
refs #2290
Activity