Skip to content

Commit

Permalink
feat(webmap): add labelVisibility layer adapter option
Browse files Browse the repository at this point in the history
  • Loading branch information
rendrom committed Mar 15, 2023
1 parent 1d0e842 commit 7c8ed91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -79,6 +79,7 @@ export class GeoJsonAdapter

constructor(public map: Map, public options: GeoJsonAdapterOptions) {
super(map, options);
this._labelVisibility = options.labelVisibility ?? this._labelVisibility;
this.displayProjection = map.getView().getProjection().getCode();
}

Expand Down
10 changes: 8 additions & 2 deletions packages/webmap/src/interfaces/LayerAdapter.ts
Expand Up @@ -334,9 +334,15 @@ export interface VectorAdapterOptions<
* @defaultValue 50
*/
clusterRadius?: number;
labelOnHover?: boolean;
labelField?: keyof P extends null ? string : keyof P;

label?: (e: LayerDefinition<F, L>) => string;
labelField?: keyof P extends null ? string : keyof P;
labelOnHover?: boolean;
/**
* Show set label immediately
* @defaultValue false
*/
labelVisibility?: boolean;

source?: unknown;
/**
Expand Down

0 comments on commit 7c8ed91

Please sign in to comment.