|
|
|
@ -42,6 +42,7 @@ import { Polygon } from './polygon'; |
|
|
|
import { createTooltip, parseArray, safeExecute } from '@home/components/widget/lib/maps/maps-utils'; |
|
|
|
import { WidgetContext } from '@home/models/widget-component.models'; |
|
|
|
import { DatasourceData } from '@shared/models/widget.models'; |
|
|
|
import { deepClone } from '@core/utils'; |
|
|
|
|
|
|
|
export default abstract class LeafletMap { |
|
|
|
|
|
|
|
@ -57,6 +58,7 @@ export default abstract class LeafletMap { |
|
|
|
markersCluster: MarkerClusterGroup; |
|
|
|
points: FeatureGroup; |
|
|
|
markersData: FormattedData[] = []; |
|
|
|
polygonsData: FormattedData[] = []; |
|
|
|
|
|
|
|
protected constructor(public ctx: WidgetContext, |
|
|
|
public $container: HTMLElement, |
|
|
|
@ -480,6 +482,7 @@ export default abstract class LeafletMap { |
|
|
|
|
|
|
|
updatePolygons(polyData: FormattedData[], updateBounds = true) { |
|
|
|
const keys: string[] = []; |
|
|
|
this.polygonsData = deepClone(polyData); |
|
|
|
polyData.forEach((data: FormattedData) => { |
|
|
|
if (data && data.hasOwnProperty(this.options.polygonKeyName) && data[this.options.polygonKeyName] !== null) { |
|
|
|
if (typeof (data[this.options.polygonKeyName]) === 'string') { |
|
|
|
|