Refactoring: L.latLng factory to call constructor with explicit arguments number
This commit is contained in:
parent
c8e5d7c61b
commit
65cc3c813b
@ -61,9 +61,12 @@ L.latLng = function (a, b, c) {
|
||||
return a;
|
||||
}
|
||||
if (L.Util.isArray(a) && typeof a[0] !== 'object') {
|
||||
if (a.length >= 2) {
|
||||
if (a.length === 3) {
|
||||
return new L.LatLng(a[0], a[1], a[2]);
|
||||
}
|
||||
if (a.length === 2) {
|
||||
return new L.LatLng(a[0], a[1]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (a === undefined || a === null) {
|
||||
|
Loading…
Reference in New Issue
Block a user