diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts index c1fc2a4264..1cad411817 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-widget2.ts @@ -39,9 +39,7 @@ import { JsonSettingsSchema } from '@shared/models/widget.models'; import { EntityId } from '@shared/models/id/entity-id'; import { AttributeScope } from '@shared/models/telemetry/telemetry.models'; import { AttributeService } from '@core/http/attribute.service'; - -let providerSets; -let defaultSettings; +import { Type } from '@angular/core'; export class MapWidgetController implements MapWidgetInterface { @@ -141,7 +139,7 @@ export class MapWidgetController implements MapWidgetInterface { }); } - initSettings(settings: UnitedMapSettings) { + initSettings(settings: UnitedMapSettings): UnitedMapSettings { const functionParams = ['data', 'dsData', 'dsIndex']; this.provider = settings.provider || this.mapProvider; const customOptions = { @@ -190,12 +188,12 @@ export class MapWidgetController implements MapWidgetInterface { export let TbMapWidgetV2: MapWidgetStaticInterface = MapWidgetController; interface IProvider { - MapClass: LeafletMap, + MapClass: Type, schema: JsonSettingsSchema, name: string } -providerSets = { +export const providerSets: {[key: string]: IProvider} = { 'openstreet-map': { MapClass: OpenStreetMap, schema: openstreetMapSettingsSchema, @@ -221,9 +219,9 @@ providerSets = { schema: imageMapSettingsSchema, name: 'image-map' } -} +}; -defaultSettings = { +export const defaultSettings: any = { xPosKeyName: 'xPos', yPosKeyName: 'yPos', markerOffsetX: 0.5, @@ -257,4 +255,4 @@ defaultSettings = { credentials: '', markerClusteringSetting: null, draggableMarker: false -} +};