diff --git a/elements/map/src/generate.ts b/elements/map/src/generate.ts index 62ecd4d35..e12ad51a9 100644 --- a/elements/map/src/generate.ts +++ b/elements/map/src/generate.ts @@ -53,6 +53,10 @@ export type EoxLayer = { properties: object & { id: string; }; + minZoom?: number; + maxZoom?: number; + minResolution?: number; + maxResolution?: number; opacity?: number; visible?: boolean; source?: { type: sourceType }; diff --git a/elements/map/src/select.ts b/elements/map/src/select.ts index d1be365a8..82f48abc5 100644 --- a/elements/map/src/select.ts +++ b/elements/map/src/select.ts @@ -68,17 +68,16 @@ export class EOxSelectInteraction { if (this.options.layer) { layerDefinition = this.options.layer; } else { - const type = - this.selectLayer instanceof VectorLayer ? "Vector" : "VectorTile"; // a layer can be defined by only its style property as a shorthand. + const originalJsonDefinition = this.selectLayer.get("_jsonDefinition"); layerDefinition = { + ...originalJsonDefinition, style: options.style, - type, properties: { id: layerId + "_select", }, source: { - type, + type: originalJsonDefinition.type, }, } as EoxLayer; }