Skip to content

Commit

Permalink
Merge pull request #289 from EOX-A/map/feature/select-layer
Browse files Browse the repository at this point in the history
fix: select style layer attributes
  • Loading branch information
silvester-pari authored Oct 10, 2023
2 parents bbb37ee + f1a5346 commit af4a1ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions elements/map/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
7 changes: 3 additions & 4 deletions elements/map/src/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit af4a1ab

Please sign in to comment.