Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
HARP-14086: Deprecate GeometryKind filtering.
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicsulfate committed Feb 8, 2021
1 parent ffdb21c commit a2a323d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions @here/harp-datasource-protocol/lib/TechniqueParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type MetricUnit = "Meter" | "Pixel";

/**
* Standard kinds of geometry.
* @deprecated See {@link BaseTechniqueParams.kind}.
*/
export enum StandardGeometryKind {
/**
Expand Down Expand Up @@ -99,6 +100,7 @@ export enum StandardGeometryKind {
*```
* If specified in this way, specific types of data (here: highway roads) can be enabled and/or
* disabled.
* @deprecated See {@link BaseTechniqueParams.kind}.
*/
export type GeometryKind = string | StandardGeometryKind;

Expand Down Expand Up @@ -240,6 +242,7 @@ export interface BaseTechniqueParams {
* One kind is set as default in the technique, and can be overridden in the style.
*
* @deprecated Use {@link enabled} with expressions based on `['dynamic-properties']` operator.
* See "object picking" example.
*/
kind?: GeometryKind | GeometryKindSet;

Expand Down
1 change: 1 addition & 0 deletions @here/harp-mapview/lib/MapView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,7 @@ export class MapView extends EventDispatcher {
/**
* The [[TileGeometryManager]] manages geometry during loading and handles hiding geometry of
* specified [[GeometryKind]]s.
* @deprecated
*/
get tileGeometryManager(): TileGeometryManager | undefined {
return this.m_tileGeometryManager;
Expand Down
18 changes: 18 additions & 0 deletions @here/harp-mapview/lib/geometry/TileGeometryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,52 @@ type TileUpdateCallback = (tile: Tile) => void;

/**
* Manages the content (the geometries) of a tile.
* @internal
*/
export class TileGeometryManager {
/**
* The set of geometry kinds that is enabled. Their geometry will be created after decoding.
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
get enabledGeometryKinds(): GeometryKindSet {
return this.enabledKinds;
}

/**
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
set enabledGeometryKinds(kinds: GeometryKindSet) {
this.enabledKinds = kinds;
}

/**
* The set of geometry kinds that is disabled. Their geometry will not be created after
* decoding.
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
get disabledGeometryKinds(): GeometryKindSet {
return this.disabledKinds;
}

/**
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
set disabledGeometryKinds(kinds: GeometryKindSet) {
this.disabledKinds = kinds;
}

/**
* The set of geometry kinds that is hidden. Their geometry may be created, but it is hidden
* until the method `hideKind` with an argument of `addOrRemoveToHiddenSet:false` is called.
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
get hiddenGeometryKinds(): GeometryKindSet {
return this.hiddenKinds;
}

/**
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
set hiddenGeometryKinds(kinds: GeometryKindSet) {
this.hiddenKinds = kinds;
this.incrementVisibilityCounter();
Expand All @@ -55,6 +68,7 @@ export class TileGeometryManager {
/**
* If set to `true`, the filters of enabled/disabledGeometryKinds are applied, otherwise they
* are ignored.
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
enableFilterByKind: boolean = true;

Expand Down Expand Up @@ -121,6 +135,7 @@ export class TileGeometryManager {
* from the enabled set.
* @param {boolean} addOrRemoveToEnabledSet Pass in `true` to add the kind to the set, pass in
* `false` to remove from that set.
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
enableKind(
kind: GeometryKind | GeometryKind[] | GeometryKindSet,
Expand All @@ -136,6 +151,7 @@ export class TileGeometryManager {
* from the disabled set.
* @param {boolean} addOrRemoveToHiddenSet Pass in `true` to add the kind to the set, pass in
* `false` to remove from that set.
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
disableKind(
kind: GeometryKind | GeometryKind[] | GeometryKindSet,
Expand All @@ -151,6 +167,7 @@ export class TileGeometryManager {
* from the hidden set.
* @param {boolean} addOrRemoveToHiddenSet Pass in `true` to hide the kind(s), `false` to show
* it again.
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
hideKind(
kind: GeometryKind | GeometryKind[] | GeometryKindSet,
Expand Down Expand Up @@ -182,6 +199,7 @@ export class TileGeometryManager {
*
* @param {IterableIterator<Tile>} tiles The
* @returns {GeometryKindSet}
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
getAvailableKinds(tiles: IterableIterator<Tile>): GeometryKindSet {
const visibleKinds: GeometryKindSet = new GeometryKindSet();
Expand Down
16 changes: 16 additions & 0 deletions @here/harp-vectortile-datasource/lib/OmvDataFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
export interface OmvFeatureFilter {
/**
* Returns `true` if the filter contains rules for specific kinds.
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
hasKindFilter: boolean;

Expand Down Expand Up @@ -73,6 +74,7 @@ export interface OmvFeatureFilter {
*
* @param {(string | string[])} kind Tag "kind" of the tag.
* @returns {boolean}
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
wantsKind(kind: string | string[]): boolean;
}
Expand Down Expand Up @@ -328,6 +330,7 @@ export class OmvFeatureFilterDescriptionBuilder {
* Add all the specified strings as "enabledKinds".
*
* @param {string[]} enabledKinds List of kinds that should be generated.
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
processKinds(enabledKinds: string[]) {
this.m_kindsToProcess = this.m_kindsToProcess.concat(enabledKinds);
Expand All @@ -337,6 +340,7 @@ export class OmvFeatureFilterDescriptionBuilder {
* Add all the specified strings as "disabledKinds".
*
* @param {string[]} disabledKinds List of kinds that should _not_ be generated.
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
ignoreKinds(disabledKinds: string[]) {
this.m_kindsToIgnore = this.m_kindsToIgnore.concat(disabledKinds);
Expand Down Expand Up @@ -631,6 +635,9 @@ export class OmvGenericFeatureFilter implements OmvFeatureFilter {
);
}

/**
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
wantsKind(kind: string | string[]): boolean {
// undefined -> no way to filter
if (kind === undefined) {
Expand All @@ -647,6 +654,9 @@ export class OmvGenericFeatureFilter implements OmvFeatureFilter {
);
}

/**
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
get hasKindFilter(): boolean {
return this.enabledKinds !== undefined || this.disabledKinds !== undefined;
}
Expand Down Expand Up @@ -698,6 +708,9 @@ export class OmvGenericFeatureFilter implements OmvFeatureFilter {
export class ComposedDataFilter implements OmvFeatureFilter {
constructor(readonly filters: OmvFeatureFilter[]) {}

/**
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
get hasKindFilter() {
return this.filters.reduce<boolean>(
(result, filter) => result && filter.hasKindFilter,
Expand Down Expand Up @@ -733,6 +746,9 @@ export class ComposedDataFilter implements OmvFeatureFilter {
);
}

/**
* @deprecated See {@link @here/here-datasource-protocol/BaseTechniqueParams.kind}.
*/
wantsKind(kind: string | string[]): boolean {
return this.filters.reduce<boolean>(
(result, filter) => result && filter.wantsKind(kind),
Expand Down

0 comments on commit a2a323d

Please sign in to comment.