Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ImageProviderOptions

Options to configure the ImageProvider.

Hierarchy

Index

Properties

Optional attribution

Attribution information for data sources used by this provider.

Attributions are automatically displayed or hidden depending on whether the corresponding data is currently active or visible on the map — e.g., based on zoom level, layer visibility, or usage. This ensures that only active data providers are credited, as required by licensing.

Can be a simple string (displayed as static text), or an array of structured attribution entries that support clickable labels and optional tooltips.

example

// Simple attribution string attribution: "© Data Provider"

example

// Multiple detailed attributions attribution: [ { label: "© Elevation Provider", url: "https://elevation.example.com", title: "Elevation data source" }, { label: "Imagery © HERE Maps", url: "https://www.here.com", title: "Satellite imagery by HERE" } ]

Optional errorImage

errorImage: string | HTMLImageElement

An Image url or Image that will be displayed for errored tile requests.

Optional id

id: string

optional id to identify the provider.

Optional margin

margin: number

Tile margin of the provider.

Optional name

name: string

Name of the provider.

url

url: string | ((z: number, y: number, x: number, quadkey: string) => string)

URL for requesting tiles.

It is either a string which may contain following flags that will be replaced by provider:

  • {SUBDOMAIN_CHAR}: subdomain id(a, b, c and d) for balancing the load
  • {SUBDOMAIN_INT}: subdomain id(0,1,2 and 3) for balancing the load
  • {SUBDOMAIN_INT_1_4}: subdomain id(1,2,3 and 4) for balancing the load
  • {QUADKEY}: quadkey of the tile to be requested
  • {Z}: z of the tile to be requested
  • {X}: x of the tile to be requested
  • {Y}: y of the tile to be requested

or a callback function that's called with the following parameters z,y,x,quadkey and needs to return the url for the respective tile. The callback function needs to handle custom parameters by its own.

Methods

Optional preProcessor

  • preProcessor(input: { data: any; ready: (data: HTMLImageElement) => void; tile?: { x: number; y: number; z: number } }): HTMLImageElement | Promise<HTMLImageElement>
  • PreProcessor for remote data sources. The PreProcessor will be executed just after data is being received from remote backend. If the processor function is returning the processed data then its treated as a synchronous processor. If the processor function does not return any value (undefined) or a Promise then its treated as asynchronous processor. An asynchronous processor that's not using a Promise MUST call the input.ready(..) callback when data processing is finished.

    Due to the execution of the processor in a separate worker thread the processor function must be scope independent. The processor must be a "standalone function/class" that only depends on its own scope and only accesses its own local variables. No references to the outer scope of the processor function are allowed.

    example
    // PreProcessor:
     ({data: any[], ready: (HTMLImageElement) => void, tile?:{x:number,y:number,z:number}) => HTMLImageElement | Promise<HTMLImageElement>
    

    Parameters

    • input: { data: any; ready: (data: HTMLImageElement) => void; tile?: { x: number; y: number; z: number } }
      • data: any
      • ready: (data: HTMLImageElement) => void
          • (data: HTMLImageElement): void
          • Parameters

            • data: HTMLImageElement

            Returns void

      • Optional tile?: { x: number; y: number; z: number }
        • x: number
        • y: number
        • z: number

    Returns HTMLImageElement | Promise<HTMLImageElement>

Generated using TypeDoc