Fix: draggable marker setting on the input maps did not work
This commit is contained in:
parent
ed841e0c67
commit
cb6a21fed6
@ -16,7 +16,8 @@
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
DEFAULT_MAP_PAGE_SIZE,
|
DEFAULT_MAP_PAGE_SIZE,
|
||||||
defaultSettings, FormattedData,
|
defaultSettings,
|
||||||
|
FormattedData,
|
||||||
hereProviders,
|
hereProviders,
|
||||||
MapProviders,
|
MapProviders,
|
||||||
providerSets,
|
providerSets,
|
||||||
@ -34,7 +35,7 @@ import {
|
|||||||
import { MapWidgetInterface, MapWidgetStaticInterface } from './map-widget.interface';
|
import { MapWidgetInterface, MapWidgetStaticInterface } from './map-widget.interface';
|
||||||
import { addCondition, addGroupInfo, addToSchema, initSchema, mergeSchemes } from '@core/schema-utils';
|
import { addCondition, addGroupInfo, addToSchema, initSchema, mergeSchemes } from '@core/schema-utils';
|
||||||
import { WidgetContext } from '@app/modules/home/models/widget-component.models';
|
import { WidgetContext } from '@app/modules/home/models/widget-component.models';
|
||||||
import { getDefCenterPosition, parseArray, parseData, parseFunction, parseWithTranslation } from './maps-utils';
|
import { getDefCenterPosition, parseData, parseFunction, parseWithTranslation } from './maps-utils';
|
||||||
import { Datasource, DatasourceData, JsonSettingsSchema, WidgetActionDescriptor } from '@shared/models/widget.models';
|
import { Datasource, DatasourceData, JsonSettingsSchema, WidgetActionDescriptor } from '@shared/models/widget.models';
|
||||||
import { EntityId } from '@shared/models/id/entity-id';
|
import { EntityId } from '@shared/models/id/entity-id';
|
||||||
import { AttributeScope, DataKeyType, LatestTelemetry } from '@shared/models/telemetry/telemetry.models';
|
import { AttributeScope, DataKeyType, LatestTelemetry } from '@shared/models/telemetry/telemetry.models';
|
||||||
@ -65,10 +66,7 @@ export class MapWidgetController implements MapWidgetInterface {
|
|||||||
if (!$element) {
|
if (!$element) {
|
||||||
$element = ctx.$container[0];
|
$element = ctx.$container[0];
|
||||||
}
|
}
|
||||||
this.settings = this.initSettings(ctx.settings);
|
this.settings = this.initSettings(ctx.settings, isEdit);
|
||||||
if (isEdit) {
|
|
||||||
this.settings.draggableMarker = true;
|
|
||||||
}
|
|
||||||
this.settings.tooltipAction = this.getDescriptors('tooltipAction');
|
this.settings.tooltipAction = this.getDescriptors('tooltipAction');
|
||||||
this.settings.markerClick = this.getDescriptors('markerClick');
|
this.settings.markerClick = this.getDescriptors('markerClick');
|
||||||
this.settings.polygonClick = this.getDescriptors('polygonClick');
|
this.settings.polygonClick = this.getDescriptors('polygonClick');
|
||||||
@ -241,7 +239,7 @@ export class MapWidgetController implements MapWidgetInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initSettings(settings: UnitedMapSettings): UnitedMapSettings {
|
initSettings(settings: UnitedMapSettings, isEditMap?: boolean): UnitedMapSettings {
|
||||||
const functionParams = ['data', 'dsData', 'dsIndex'];
|
const functionParams = ['data', 'dsData', 'dsIndex'];
|
||||||
this.provider = settings.provider || this.mapProvider;
|
this.provider = settings.provider || this.mapProvider;
|
||||||
if (this.provider === MapProviders.here && !settings.mapProviderHere) {
|
if (this.provider === MapProviders.here && !settings.mapProviderHere) {
|
||||||
@ -269,6 +267,9 @@ export class MapWidgetController implements MapWidgetInterface {
|
|||||||
size: settings.markerImageSize || 34
|
size: settings.markerImageSize || 34
|
||||||
} : null
|
} : null
|
||||||
}
|
}
|
||||||
|
if (isEditMap && !settings.hasOwnProperty('draggableMarker')) {
|
||||||
|
settings.draggableMarker = true;
|
||||||
|
}
|
||||||
return { ...defaultSettings, ...settings, ...customOptions, }
|
return { ...defaultSettings, ...settings, ...customOptions, }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user