Showing
1 changed file
with
14 additions
and
13 deletions
@@ -17,12 +17,12 @@ | @@ -17,12 +17,12 @@ | ||
17 | import { defaultSettings, hereProviders, MapProviders, providerSets, UnitedMapSettings } from './map-models'; | 17 | import { defaultSettings, hereProviders, MapProviders, providerSets, UnitedMapSettings } from './map-models'; |
18 | import LeafletMap from './leaflet-map'; | 18 | import LeafletMap from './leaflet-map'; |
19 | import { | 19 | import { |
20 | - commonMapSettingsSchema, | ||
21 | - mapPolygonSchema, | ||
22 | - mapProviderSchema, | ||
23 | - markerClusteringSettingsSchema, | ||
24 | - markerClusteringSettingsSchemaLeaflet, | ||
25 | - routeMapSettingsSchema | 20 | + commonMapSettingsSchema, |
21 | + mapPolygonSchema, | ||
22 | + mapProviderSchema, | ||
23 | + markerClusteringSettingsSchema, | ||
24 | + markerClusteringSettingsSchemaLeaflet, | ||
25 | + routeMapSettingsSchema | ||
26 | } from './schemes'; | 26 | } from './schemes'; |
27 | import { MapWidgetInterface, MapWidgetStaticInterface } from './map-widget.interface'; | 27 | import { MapWidgetInterface, MapWidgetStaticInterface } from './map-widget.interface'; |
28 | import { addCondition, addGroupInfo, addToSchema, initSchema, mergeSchemes } from '@core/schema-utils'; | 28 | import { addCondition, addGroupInfo, addToSchema, initSchema, mergeSchemes } from '@core/schema-utils'; |
@@ -30,17 +30,18 @@ import { of, Subject } from 'rxjs'; | @@ -30,17 +30,18 @@ import { of, Subject } from 'rxjs'; | ||
30 | import { WidgetContext } from '@app/modules/home/models/widget-component.models'; | 30 | import { WidgetContext } from '@app/modules/home/models/widget-component.models'; |
31 | import { getDefCenterPosition, parseArray, parseData, parseFunction, parseWithTranslation } from './maps-utils'; | 31 | import { getDefCenterPosition, parseArray, parseData, parseFunction, parseWithTranslation } from './maps-utils'; |
32 | import { | 32 | import { |
33 | - Datasource, | ||
34 | - DatasourceType, | ||
35 | - JsonSettingsSchema, | ||
36 | - WidgetActionDescriptor, | ||
37 | - widgetType | 33 | + Datasource, |
34 | + DatasourceType, | ||
35 | + JsonSettingsSchema, | ||
36 | + WidgetActionDescriptor, | ||
37 | + widgetType | ||
38 | } from '@shared/models/widget.models'; | 38 | } from '@shared/models/widget.models'; |
39 | import { EntityId } from '@shared/models/id/entity-id'; | 39 | import { EntityId } from '@shared/models/id/entity-id'; |
40 | import { AttributeScope, DataKeyType, LatestTelemetry } from '@shared/models/telemetry/telemetry.models'; | 40 | import { AttributeScope, DataKeyType, LatestTelemetry } from '@shared/models/telemetry/telemetry.models'; |
41 | import { AttributeService } from '@core/http/attribute.service'; | 41 | import { AttributeService } from '@core/http/attribute.service'; |
42 | import { TranslateService } from '@ngx-translate/core'; | 42 | import { TranslateService } from '@ngx-translate/core'; |
43 | import { UtilsService } from '@core/services/utils.service'; | 43 | import { UtilsService } from '@core/services/utils.service'; |
44 | +import _ from 'lodash'; | ||
44 | 45 | ||
45 | // @dynamic | 46 | // @dynamic |
46 | export class MapWidgetController implements MapWidgetInterface { | 47 | export class MapWidgetController implements MapWidgetInterface { |
@@ -90,9 +91,9 @@ export class MapWidgetController implements MapWidgetInterface { | @@ -90,9 +91,9 @@ export class MapWidgetController implements MapWidgetInterface { | ||
90 | } | 91 | } |
91 | 92 | ||
92 | public static getProvidersSchema(mapProvider: MapProviders, ignoreImageMap = false) { | 93 | public static getProvidersSchema(mapProvider: MapProviders, ignoreImageMap = false) { |
94 | + const providerSchema = _.cloneDeep(mapProviderSchema); | ||
93 | if (mapProvider) | 95 | if (mapProvider) |
94 | - mapProviderSchema.schema.properties.provider.default = mapProvider; | ||
95 | - const providerSchema = mapProviderSchema; | 96 | + providerSchema.schema.properties.provider.default = mapProvider; |
96 | if (ignoreImageMap) { | 97 | if (ignoreImageMap) { |
97 | providerSchema.form[0].items = providerSchema.form[0]?.items.filter(item => item.value !== 'image-map'); | 98 | providerSchema.form[0].items = providerSchema.form[0]?.items.filter(item => item.value !== 'image-map'); |
98 | } | 99 | } |