Commit c94b4e1d69f0c3577fa2e7be0161bc26667016c1
1 parent
fc597f2c
Fix: resize polygons for image map
Showing
2 changed files
with
4 additions
and
0 deletions
... | ... | @@ -42,6 +42,7 @@ import { Polygon } from './polygon'; |
42 | 42 | import { createTooltip, parseArray, safeExecute } from '@home/components/widget/lib/maps/maps-utils'; |
43 | 43 | import { WidgetContext } from '@home/models/widget-component.models'; |
44 | 44 | import { DatasourceData } from '@shared/models/widget.models'; |
45 | +import { deepClone } from '@core/utils'; | |
45 | 46 | |
46 | 47 | export default abstract class LeafletMap { |
47 | 48 | |
... | ... | @@ -57,6 +58,7 @@ export default abstract class LeafletMap { |
57 | 58 | markersCluster: MarkerClusterGroup; |
58 | 59 | points: FeatureGroup; |
59 | 60 | markersData: FormattedData[] = []; |
61 | + polygonsData: FormattedData[] = []; | |
60 | 62 | |
61 | 63 | protected constructor(public ctx: WidgetContext, |
62 | 64 | public $container: HTMLElement, |
... | ... | @@ -480,6 +482,7 @@ export default abstract class LeafletMap { |
480 | 482 | |
481 | 483 | updatePolygons(polyData: FormattedData[], updateBounds = true) { |
482 | 484 | const keys: string[] = []; |
485 | + this.polygonsData = deepClone(polyData); | |
483 | 486 | polyData.forEach((data: FormattedData) => { |
484 | 487 | if (data && data.hasOwnProperty(this.options.polygonKeyName) && data[this.options.polygonKeyName] !== null) { |
485 | 488 | if (typeof (data[this.options.polygonKeyName]) === 'string') { | ... | ... |