moved from Array<> to LatLngTuple[] types
This commit is contained in:
parent
5db2c85f4c
commit
ac6e946b2b
@ -362,12 +362,12 @@ export default abstract class LeafletMap {
|
||||
return L.latLng(lat, lng) as L.LatLng;
|
||||
}
|
||||
|
||||
convertPositionPolygon(expression:LatLngExpression[][] | LatLngExpression[][][]) {
|
||||
return (expression as Array<any>).map((el) => {
|
||||
if (el.length === 2 && !el.some(isNaN)) {
|
||||
convertPositionPolygon(expression: (LatLngTuple | LatLngTuple[] | LatLngTuple[][])[]) {
|
||||
return (expression).map((el) => {
|
||||
if (!Array.isArray(el[0]) && el.length === 2) {
|
||||
return el;
|
||||
} else if (isArray(el) && el.length) {
|
||||
return this.convertPositionPolygon(el);
|
||||
} else if (Array.isArray(el) && el.length) {
|
||||
return this.convertPositionPolygon(el as LatLngTuple[] | LatLngTuple[][]);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -224,14 +224,14 @@ export class ImageMap extends LeafletMap {
|
||||
expression.y * this.height);
|
||||
}
|
||||
|
||||
convertPositionPolygon(expression: LatLngExpression[][] | LatLngExpression[][][]) {
|
||||
return (expression as Array<any>).map((el) => {
|
||||
if (el.length === 2 && !el.some(isNaN)) {
|
||||
convertPositionPolygon(expression: (LatLngTuple | LatLngTuple[] | LatLngTuple[][])[]){
|
||||
return (expression).map((el) => {
|
||||
if (!Array.isArray(el[0]) && !Array.isArray(el[1]) && el.length === 2) {
|
||||
return this.pointToLatLng(
|
||||
el[0] * this.width,
|
||||
el[1] * this.height)
|
||||
} else if (isArray(el) && el.length) {
|
||||
return this.convertPositionPolygon(el);
|
||||
} else if (Array.isArray(el) && el.length) {
|
||||
return this.convertPositionPolygon(el as LatLngTuple[] | LatLngTuple[][]);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user