Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PoiManager

POI manager class, responsible for loading the {@link @here/harp-datasource-protocol#PoiGeometry} objects from the {@link @here/harp-datasource-protocol#DecodedTile}, and preparing them for rendering.

remarks

Also loads and manages the texture atlases for the icons.

Hierarchy

  • PoiManager

Index

Constructors

constructor

Properties

Readonly mapView

mapView: MapView

The MapView instance that should display the POIs.

Methods

addImageTexture

  • Add an {@link @here/harp-datasource-protocol#ImageTexture} such that it is available as a named entity for techniques in theme files.

    Parameters

    • imageTexture: ImageTexture

      {@link @here/harp-datasource-protocol#ImageTexture} that should be available for POIs.

    Returns void

addPois

  • Add all POIs from a decoded tile and store them as TextElements in the Tile.

    Also handles LineMarkers, which is a recurring marker along a line (road).

    Parameters

    • tile: Tile

      Tile to add POIs to.

    • decodedTile: DecodedTile

      DecodedTile containing the raw {@link @here/harp-datasource-protocol#PoiGeometry} objects describing the POIs.

    Returns void

addTextureAtlas

  • addTextureAtlas(imageName: string, atlas: string, abortSignal?: AbortSignal): Promise<void>
  • Load the texture atlas that defines the segments of the texture that should be used for specific icons.

    remarks

    Creates an {@link @here/harp-datasource-protocol#ImageTexture} for every element in the atlas, such that it can be addressed in the theme file.

    Parameters

    • imageName: string

      Name of the image from the theme (NOT the url!).

    • atlas: string

      URL of the JSON file defining the texture atlas.

    • Optional abortSignal: AbortSignal

      Signal to Abort the loading of the Atlas Image

    Returns Promise<void>

clear

  • clear(): void

getImageTexture

updatePoiFromPoiTable

  • updatePoiFromPoiTable(pointLabel: TextElement): boolean
  • Update the TextElement with the information taken from the PoiTable which is referenced in the PoiInfo of the pointLabel.

    If the requested PoiTable is not available yet, the function returns false. If the PoiTable is not defined, or if the references POI has no entry in the PoiTable, no action is taken, and the function returns false.

    If the PoiTable has been processed, it returns true, indicating that this function doesn't have to be called again.

    Parameters

    Returns boolean

    true if the PoiTable has been processed, and the function does not have to be called again.

Generated using TypeDoc