-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
I have an object that maintains and manipulates its own set of verts, I am currently doing: "L.Polygon(region.verts.slice(0), style)" using .slice(0) to duplicate the array, since if I pass in region.verts directly, the array gets modified by the _convertLatLngs function.
_convertLatLngs: function (latlngs) {
var i, len;
for (i = 0, len = latlngs.length; i < len; i++) {
if (latlngs[i] instanceof Array && typeof latlngs[i][0] !== 'number') {
return;
}
latlngs[i] = L.latLng(latlngs[i]);
}
return latlngs;
}
It seems like it would be nice if we could have something like "var new_latlngs", "new_latlngs[i] = L.latLng(latlngs[i]);" so people wouldn't have to worry about this.
If people are considering the overwrite to be a feature, if so maybe we could have an option to toggle this behavior off?
Thanks for your attention.