|
@@ -417,25 +417,25 @@ export default abstract class LeafletMap { |
|
@@ -417,25 +417,25 @@ export default abstract class LeafletMap { |
417
|
};
|
417
|
};
|
418
|
}
|
418
|
}
|
419
|
|
419
|
|
420
|
- convertToPolygonFormat(points: Array<any>): Array<any> {
|
|
|
421
|
- if (points.length) {
|
|
|
422
|
- return points.map(point => {
|
|
|
423
|
- if (point.length) {
|
|
|
424
|
- return this.convertToPolygonFormat(point);
|
|
|
425
|
- } else {
|
|
|
426
|
- return [point.lat, point.lng];
|
|
|
427
|
- }
|
|
|
428
|
- });
|
|
|
429
|
- } else {
|
|
|
430
|
- return [];
|
420
|
+ convertToPolygonFormat(points: Array<any>): Array<any> {
|
|
|
421
|
+ if (points.length) {
|
|
|
422
|
+ return points.map(point => {
|
|
|
423
|
+ if (point.length) {
|
|
|
424
|
+ return this.convertToPolygonFormat(point);
|
|
|
425
|
+ } else {
|
|
|
426
|
+ return [point.lat, point.lng];
|
|
|
427
|
+ }
|
|
|
428
|
+ });
|
|
|
429
|
+ } else {
|
|
|
430
|
+ return [];
|
|
|
431
|
+ }
|
431
|
}
|
432
|
}
|
432
|
- }
|
|
|
433
|
|
433
|
|
434
|
- convertPolygonToCustomFormat(expression: any[][]): object {
|
|
|
435
|
- return {
|
|
|
436
|
- [this.options.polygonKeyName] : this.convertToPolygonFormat(expression)
|
|
|
437
|
- };
|
|
|
438
|
- }
|
434
|
+ convertPolygonToCustomFormat(expression: any[][]): object {
|
|
|
435
|
+ return {
|
|
|
436
|
+ [this.options.polygonKeyName] : this.convertToPolygonFormat(expression)
|
|
|
437
|
+ };
|
|
|
438
|
+ }
|
439
|
|
439
|
|
440
|
updateData(drawRoutes: boolean, showPolygon: boolean) {
|
440
|
updateData(drawRoutes: boolean, showPolygon: boolean) {
|
441
|
this.drawRoutes = drawRoutes;
|
441
|
this.drawRoutes = drawRoutes;
|
|
@@ -592,11 +592,10 @@ export default abstract class LeafletMap { |
|
@@ -592,11 +592,10 @@ export default abstract class LeafletMap { |
592
|
}
|
592
|
}
|
593
|
|
593
|
|
594
|
deletePolygon(key: string) {
|
594
|
deletePolygon(key: string) {
|
595
|
- let polygon = this.polygons.get(key)?.leafletPoly;
|
595
|
+ const polygon = this.polygons.get(key)?.leafletPoly;
|
596
|
if (polygon) {
|
596
|
if (polygon) {
|
597
|
this.map.removeLayer(polygon);
|
597
|
this.map.removeLayer(polygon);
|
598
|
this.polygons.delete(key);
|
598
|
this.polygons.delete(key);
|
599
|
- polygon = null;
|
|
|
600
|
}
|
599
|
}
|
601
|
return polygon;
|
600
|
return polygon;
|
602
|
}
|
601
|
}
|