allow for no overwrite option in covertLatLngs
This commit is contained in:
parent
0b14d71d7a
commit
57d42d1636
@ -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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user