Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TileProvider

The TileProvider is an abstract Provider that serves map-data partitioned in {@link 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

clear

  • clear(bbox?: any): void
  • Clear all features in.

    Parameters

    • Optional bbox: any

    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

getCachedTilesOfBBox

  • getCachedTilesOfBBox(bbox: number[], zoomlevel?: number): Tile[]
  • get cached tile by bounding box.

    Parameters

    • bbox: number[]

      array of coordinates in order: [minLon, minLat, maxLon, maxLat]

    • Optional zoomlevel: number

      get tiles at specified tileMargin

    Returns Tile[]

    array of {@link Tiles}

Abstract getTile

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

    Parameters

    • quadkey: string

      quadkey of the tile

    • callback: (tile: Tile, error?: any) => void

      the callback function

        • (tile: Tile, error?: any): void
        • Parameters

          • tile: Tile
          • Optional error: any

          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