Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ImageProvider

Tile Provider for Image/Raster data. eg: Satellite Tiles.

Hierarchy

Index

Constructors

constructor

Properties

Optional id

id: string

The id of the Provider

Optional margin

margin: number = 0

default tile margin.

Optional name

name: string

The name of the Provider.

Methods

addEventListener

  • addEventListener(type: string, listener: (e: CustomEvent) => void, _c?: any): boolean
  • Add an EventListener to the provider. Valid events: "clear" and "error"

    The detail property of the Event gives additional information about the event. detail.provider is a reference to the provider onto which the event was dispatched and is set for all events.

    Parameters

    • type: string

      A string representing the event type to listen for

    • listener: (e: CustomEvent) => void

      the listener function that will be called when an event of the specific type occurs

        • (e: CustomEvent): void
        • Parameters

          • e: CustomEvent

          Returns void

    • Optional _c: any

    Returns boolean

cancel

  • cancel(quadkey: string): void
  • cancel(tile: Tile): void
  • Cancel ongoing request(s) and drop the tile.

    Parameters

    • quadkey: string

      the quadkey of the tile that should be canceled and removed.

    Returns void

  • Cancel ongoing request(s) and drop the tile.

    Parameters

    • tile: Tile

      the tile that should be canceled and removed.

    Returns void

clear

  • Clears the given tile(s) from the provider's cache.

    Parameters

    • tiles: Tile | Tile[]

      A single Tile or an array of Tiles to be cleared.

    Returns void

  • Clears all tiles within a specified geographical bounding box.

    Parameters

    • bbox: GeoJSONBBox

      An array of geographical coordinates [minLon, minLat, maxLon, maxLat] defining the rectangular area from which tiles will be cleared.

    Returns void

  • Clears all cached tiles of the provider.

    Returns void

config

createTile

  • createTile(quadkey: string): Tile
  • Create a new Tile.

    Parameters

    • quadkey: string

      the quadkey of the tile to create

    Returns Tile

getCachedTile

  • getCachedTile(quadkey: string): Tile
  • Get a locally cached tile by quadkey.

    Parameters

    • quadkey: string

      the quadkey of the tile

    Returns Tile

getCachedTiles

  • getCachedTiles(bbox?: number[], zoomlevel?: number): Tile[]
  • Retrieves cached tiles within a specified bounding box or all cached tiles if no parameters are provided.

    If no arguments are passed, all cached tiles are returned. If a bounding box (bbox) and/or zoom level (zoomlevel) are provided, it filters the cached tiles based on the specified area and zoom level.

    Parameters

    • Optional bbox: number[]

      An optional array of coordinates defining the bounding box in the format: [minLon, minLat, maxLon, maxLat]. If provided, only tiles within this geographic area will be returned.

    • Optional zoomlevel: number

      An optional zoom level to filter tiles. If provided, only tiles at the specified zoom level will be returned.

    Returns Tile[]

    • An array of Tile objects that match the specified parameters, or all cached tiles if no parameters are given.

getTile

  • getTile(quadkey: string, cb: (tile: Tile) => void): any
  • Get a tile by quadkey.

    Parameters

    • quadkey: string

      quadkey of the tile

    • cb: (tile: Tile) => void
        • (tile: Tile): void
        • Parameters

          Returns void

    Returns any

    the Tile is returned if its already cached locally

removeEventListener

  • removeEventListener(type: string, listener: (e: CustomEvent) => void, _c?: any): boolean
  • Remove an EventListener from the provider. Valid events: "clear" and "error"

    Parameters

    • type: string

      A string which specifies the type of event for which to remove an event listener.

    • listener: (e: CustomEvent) => void

      The listener function of the event handler to remove from the provider.

        • (e: CustomEvent): void
        • Parameters

          • e: CustomEvent

          Returns void

    • Optional _c: any

    Returns boolean

setMargin

  • setMargin(tileMargin?: number): void
  • Set the tile margin in pixel.

    Parameters

    • Default value tileMargin: number = 0

      the tileMargin

    Returns void

Generated using TypeDoc