allow for no overwrite option in covertLatLngs

This commit is contained in:
snkashis 2012-12-27 18:10:57 -05:00 committed by danzel
parent 0b14d71d7a
commit 57d42d1636

View File

@ -85,15 +85,21 @@ L.Polyline = L.Path.extend({
return bounds;
},
_convertLatLngs: function (latlngs) {
var i, len;
_convertLatLngs: function (latlngs, noOverwrite) {
var i, len, target;
if (noOverwrite) {
target = [];
}
else {
target = latlngs;
}
for (i = 0, len = latlngs.length; i < len; i++) {
if (L.Util.isArray(latlngs[i]) && typeof latlngs[i][0] !== 'number') {
return;
}
latlngs[i] = L.latLng(latlngs[i]);
target[i] = L.latLng(latlngs[i]);
}
return latlngs;
return target;
},
_initEvents: function () {