update map bundles
This commit is contained in:
parent
26e5f69b32
commit
4f8942b112
File diff suppressed because one or more lines are too long
@ -62,8 +62,9 @@ export function mergeSchemes(schemes: JsonSettingsSchema[]): JsonSettingsSchema
|
||||
}, initSchema());
|
||||
}
|
||||
|
||||
export function addCondition(schema: JsonSettingsSchema, condition: string): JsonSettingsSchema {
|
||||
export function addCondition(schema: JsonSettingsSchema, condition: string, exclude: string[] = []): JsonSettingsSchema {
|
||||
schema.form = schema.form.map(element => {
|
||||
if (!exclude.includes(element)) {
|
||||
if (typeof element === 'string') {
|
||||
return {
|
||||
key: element,
|
||||
@ -76,6 +77,7 @@ export function addCondition(schema: JsonSettingsSchema, condition: string): Jso
|
||||
}
|
||||
else element.condition = condition;
|
||||
}
|
||||
}
|
||||
return element;
|
||||
});
|
||||
return schema;
|
||||
|
||||
@ -94,22 +94,21 @@ export class MapWidgetController implements MapWidgetInterface {
|
||||
public static settingsSchema(mapProvider: MapProviders, drawRoutes: boolean): JsonSettingsSchema {
|
||||
const schema = initSchema();
|
||||
addToSchema(schema, this.getProvidersSchema(mapProvider));
|
||||
if (mapProvider !== 'image-map') {
|
||||
addGroupInfo(schema, 'Map Provider Settings');
|
||||
addToSchema(schema, commonMapSettingsSchema);
|
||||
addToSchema(schema, addCondition(commonMapSettingsSchema, 'model.provider !== "image-map"'));
|
||||
addGroupInfo(schema, 'Common Map Settings');
|
||||
addToSchema(schema, addCondition(mapPolygonSchema, 'model.showPolygon === true'));
|
||||
addToSchema(schema, addCondition(mapPolygonSchema, 'model.showPolygon=== true', ['showPolygon']));
|
||||
addGroupInfo(schema, 'Polygon Settings');
|
||||
if (drawRoutes) {
|
||||
addToSchema(schema, routeMapSettingsSchema);
|
||||
addGroupInfo(schema, 'Route Map Settings');
|
||||
} else if (mapProvider !== 'image-map') {
|
||||
} else {
|
||||
const clusteringSchema = mergeSchemes([markerClusteringSettingsSchema,
|
||||
addCondition(markerClusteringSettingsSchemaLeaflet, `model.useClusterMarkers === true`)])
|
||||
addCondition(markerClusteringSettingsSchemaLeaflet,
|
||||
`model.useClusterMarkers === true && model.provider !== "image-map"`)])
|
||||
addToSchema(schema, clusteringSchema);
|
||||
addGroupInfo(schema, 'Markers Clustering Settings');
|
||||
}
|
||||
}
|
||||
return schema;
|
||||
}
|
||||
|
||||
@ -162,7 +161,6 @@ export class MapWidgetController implements MapWidgetInterface {
|
||||
}
|
||||
|
||||
setMarkerLocation = (e) => {
|
||||
console.log("setMarkerLocation -> e", e)
|
||||
const attributeService = this.ctx.$injector.get(AttributeService);
|
||||
|
||||
const entityId: EntityId = {
|
||||
@ -186,7 +184,7 @@ export class MapWidgetController implements MapWidgetInterface {
|
||||
initSettings(settings: UnitedMapSettings): UnitedMapSettings {
|
||||
const functionParams = ['data', 'dsData', 'dsIndex'];
|
||||
this.provider = settings.provider || this.mapProvider;
|
||||
if (!settings.mapProviderHere) {
|
||||
if (this.provider === MapProviders.here && !settings.mapProviderHere) {
|
||||
if (settings.mapProvider && hereProviders.includes(settings.mapProvider))
|
||||
settings.mapProviderHere = settings.mapProvider
|
||||
else settings.mapProviderHere = hereProviders[0];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user