Showing
1 changed file
with
7 additions
and
9 deletions
... | ... | @@ -39,9 +39,7 @@ import { JsonSettingsSchema } from '@shared/models/widget.models'; |
39 | 39 | import { EntityId } from '@shared/models/id/entity-id'; |
40 | 40 | import { AttributeScope } from '@shared/models/telemetry/telemetry.models'; |
41 | 41 | import { AttributeService } from '@core/http/attribute.service'; |
42 | - | |
43 | -let providerSets; | |
44 | -let defaultSettings; | |
42 | +import { Type } from '@angular/core'; | |
45 | 43 | |
46 | 44 | export class MapWidgetController implements MapWidgetInterface { |
47 | 45 | |
... | ... | @@ -141,7 +139,7 @@ export class MapWidgetController implements MapWidgetInterface { |
141 | 139 | }); |
142 | 140 | } |
143 | 141 | |
144 | - initSettings(settings: UnitedMapSettings) { | |
142 | + initSettings(settings: UnitedMapSettings): UnitedMapSettings { | |
145 | 143 | const functionParams = ['data', 'dsData', 'dsIndex']; |
146 | 144 | this.provider = settings.provider || this.mapProvider; |
147 | 145 | const customOptions = { |
... | ... | @@ -190,12 +188,12 @@ export class MapWidgetController implements MapWidgetInterface { |
190 | 188 | export let TbMapWidgetV2: MapWidgetStaticInterface = MapWidgetController; |
191 | 189 | |
192 | 190 | interface IProvider { |
193 | - MapClass: LeafletMap, | |
191 | + MapClass: Type<LeafletMap>, | |
194 | 192 | schema: JsonSettingsSchema, |
195 | 193 | name: string |
196 | 194 | } |
197 | 195 | |
198 | -providerSets = { | |
196 | +export const providerSets: {[key: string]: IProvider} = { | |
199 | 197 | 'openstreet-map': { |
200 | 198 | MapClass: OpenStreetMap, |
201 | 199 | schema: openstreetMapSettingsSchema, |
... | ... | @@ -221,9 +219,9 @@ providerSets = { |
221 | 219 | schema: imageMapSettingsSchema, |
222 | 220 | name: 'image-map' |
223 | 221 | } |
224 | -} | |
222 | +}; | |
225 | 223 | |
226 | -defaultSettings = { | |
224 | +export const defaultSettings: any = { | |
227 | 225 | xPosKeyName: 'xPos', |
228 | 226 | yPosKeyName: 'yPos', |
229 | 227 | markerOffsetX: 0.5, |
... | ... | @@ -257,4 +255,4 @@ defaultSettings = { |
257 | 255 | credentials: '', |
258 | 256 | markerClusteringSetting: null, |
259 | 257 | draggableMarker: false |
260 | -} | |
258 | +}; | ... | ... |