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 23cf1eca2b..83568b8b9a 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 @@ -38,7 +38,7 @@ import { WidgetContext } from '@app/modules/home/models/widget-component.models' import { getDefCenterPosition } from './maps-utils'; import { JsonSettingsSchema, WidgetActionDescriptor, DatasourceType, widgetType } from '@shared/models/widget.models'; import { EntityId } from '@shared/models/id/entity-id'; -import { AttributeScope, DataKeyType } from '@shared/models/telemetry/telemetry.models'; +import { AttributeScope, DataKeyType, LatestTelemetry } from '@shared/models/telemetry/telemetry.models'; import { AttributeService } from '@core/http/attribute.service'; import { Type } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; @@ -168,30 +168,35 @@ export class MapWidgetController implements MapWidgetInterface { }; const attributes = []; const timeseries = []; + const latLngProperties = [this.settings.latKeyName, this.settings.lngKeyName, this.settings.xPosKeyName, this.settings.yPosKeyName]; e.$datasource.dataKeys.forEach(key => { - const value = { - key: key.name, - value: e[key.name] - }; - if(key.type === DataKeyType.attribute){ - attributes.push(value) - } - if(key.type === DataKeyType.timeseries){ - timeseries.push(value) + if (latLngProperties.includes(key)) { + const value = { + key: key.name, + value: e[key.name] + }; + if (key.type === DataKeyType.attribute) { + attributes.push(value) + } + if (key.type === DataKeyType.timeseries) { + timeseries.push(value) + } } - }) - attributeService.saveEntityTimeseries( - entityId, - AttributeScope.SHARED_SCOPE, - timeseries - ).subscribe(() => { - }); - attributeService.saveEntityAttributes( - entityId, - AttributeScope.SERVER_SCOPE, - attributes - ).subscribe(() => { }); + if (attributes.length) { + attributeService.saveEntityTimeseries( + entityId, + LatestTelemetry.LATEST_TELEMETRY, + timeseries + ).subscribe(() => { }); + } + if (timeseries.length) { + attributeService.saveEntityAttributes( + entityId, + AttributeScope.SERVER_SCOPE, + attributes + ).subscribe(() => { }); + } } initSettings(settings: UnitedMapSettings): UnitedMapSettings { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/markers.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/markers.ts index e032254b4d..6fb272acf5 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/markers.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/markers.ts @@ -150,7 +150,6 @@ export class Marker { } createDefaultMarkerIcon(color, onMarkerIconReady) { - const pinColor = color.substr(1); const icon = L.icon({ iconUrl: 'https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|' + color, iconSize: [21, 34], diff --git a/ui-ngx/src/app/shared/components/time/history-selector/history-selector.component.scss b/ui-ngx/src/app/shared/components/time/history-selector/history-selector.component.scss index 04a9cd71e7..22ded95a5f 100644 --- a/ui-ngx/src/app/shared/components/time/history-selector/history-selector.component.scss +++ b/ui-ngx/src/app/shared/components/time/history-selector/history-selector.component.scss @@ -90,24 +90,24 @@ mat-slider { min-width: 80px; } + } - button.mat-button.mat-icon-button { - width: 44px; - min-width: 44px; - height: 44px; - min-height: 44px; - margin: 0; - line-height: 28px; - - mat-icon { - width: 28px; - height: 28px; - font-size: 28px; - - svg { - width: inherit; - height: inherit; - } + .mat-icon-button { + width: 44px; + min-width: 44px; + height: 48px; + min-height: 48px; + margin: 0; + line-height: 28px; + + mat-icon { + width: 24px; + height: 24px; + font-size: 24px; + + svg { + width: inherit; + height: inherit; } }