|
|
|
@ -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; |
|
|
|
} |
|
|
|
|