fix map type caching

This commit is contained in:
Artem Halushko 2020-05-21 14:23:23 +03:00
parent 889e55104a
commit 20f316cec0

View File

@ -41,6 +41,7 @@ import { AttributeScope, DataKeyType, LatestTelemetry } from '@shared/models/tel
import { AttributeService } from '@core/http/attribute.service';
import { TranslateService } from '@ngx-translate/core';
import { UtilsService } from '@core/services/utils.service';
import _ from 'lodash';
// @dynamic
export class MapWidgetController implements MapWidgetInterface {
@ -90,9 +91,9 @@ export class MapWidgetController implements MapWidgetInterface {
}
public static getProvidersSchema(mapProvider: MapProviders, ignoreImageMap = false) {
const providerSchema = _.cloneDeep(mapProviderSchema);
if (mapProvider)
mapProviderSchema.schema.properties.provider.default = mapProvider;
const providerSchema = mapProviderSchema;
providerSchema.schema.properties.provider.default = mapProvider;
if (ignoreImageMap) {
providerSchema.form[0].items = providerSchema.form[0]?.items.filter(item => item.value !== 'image-map');
}