Class TileLayer

Hierarchy

Index

Classes

Constructor methods

Methods

Classes

Canvas: Canvas

constructor(options?: TileLayerOptions): Canvas

Instantiates a Canvas tile layer object given an options object (optionally).

Parameters

Returns

Canvas

public drawTile(canvas: HTMLCanvasElement, tilePoint: Point, zoom: number): Canvas

You need to define this method after creating the instance to draw tiles; canvas is the actual canvas tile on which you can draw, tilePoint represents the tile numbers, and zoom is the current zoom.

Parameters

  • canvas: HTMLCanvasElement
  • tilePoint: Point
  • zoom: number

Returns

Canvas

public redraw(): Canvas

Calling redraw will cause the drawTile method to be called for all tiles. May be used for updating dynamic content drawn on the Canvas

Returns

Canvas

WMS: WMS

constructor(baseUrl: string, options: WMSOptions): WMS

Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.

Parameters

Returns

WMS

public setParams(params: WMS, noRedraw?: boolean): WMS

Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).

Parameters

  • params: WMS
  • noRedraw?: boolean optional

Returns

WMS

Constructor methods

constructor(urlTemplate: string, options?: TileLayerOptions): TileLayer

Instantiates a tile layer object given a URL template and optionally an options object.

Parameters

Returns

TileLayer

Methods

public addEventListener(type: string, fn: (e: L.LeafletEvent) => void, context?: any): TileLayer

Parameters

  • type: string
  • fn: (e: L.LeafletEvent) => void
  • context?: any optional

Returns

TileLayer

public addEventListener(eventMap: any, context?: any): TileLayer

Parameters

  • eventMap: any
  • context?: any optional

Returns

TileLayer

public addOneTimeEventListener(type: string, fn: (e: L.LeafletEvent) => void, context?: any): TileLayer

Parameters

  • type: string
  • fn: (e: L.LeafletEvent) => void
  • context?: any optional

Returns

TileLayer

public addTo(map: Map): TileLayer

Adds the layer to the map.

Parameters

Returns

TileLayer

public bringToBack(): TileLayer

Brings the tile layer to the bottom of all tile layers.

Returns

TileLayer

public bringToFront(): TileLayer

Brings the tile layer to the top of all tile layers.

Returns

TileLayer

public clearAllEventListeners(): TileLayer

Returns

TileLayer

public fire(type: string, data?: any): TileLayer

Parameters

  • type: string
  • data?: any optional

Returns

TileLayer

public fireEvent(type: string, data?: any): TileLayer

Parameters

  • type: string
  • data?: any optional

Returns

TileLayer

public getContainer(): HTMLElement

Returns the HTML element that contains the tiles for this layer.

Returns

HTMLElement

public hasEventListeners(type: string): boolean

Parameters

  • type: string

Returns

boolean

public off(type: string, fn?: (e: L.LeafletEvent) => void, context?: any): TileLayer

Parameters

  • type: string
  • fn?: (e: L.LeafletEvent) => void optional
  • context?: any optional

Returns

TileLayer

public off(eventMap?: any, context?: any): TileLayer

Parameters

  • eventMap?: any optional
  • context?: any optional

Returns

TileLayer

public on(type: string, fn: (e: L.LeafletEvent) => void, context?: any): TileLayer

Parameters

  • type: string
  • fn: (e: L.LeafletEvent) => void
  • context?: any optional

Returns

TileLayer

public on(eventMap: any, context?: any): TileLayer

Parameters

  • eventMap: any
  • context?: any optional

Returns

TileLayer

public onAdd(map: Map)

Should contain code that creates DOM elements for the overlay, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).

Parameters

public onRemove(map: Map)

Should contain all clean up code that removes the overlay's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).

Parameters

public once(type: string, fn: (e: L.LeafletEvent) => void, context?: any): TileLayer

Parameters

  • type: string
  • fn: (e: L.LeafletEvent) => void
  • context?: any optional

Returns

TileLayer

public redraw(): TileLayer

Causes the layer to clear all the tiles and request them again.

Returns

TileLayer

public removeEventListener(type: string, fn?: (e: L.LeafletEvent) => void, context?: any): TileLayer

Parameters

  • type: string
  • fn?: (e: L.LeafletEvent) => void optional
  • context?: any optional

Returns

TileLayer

public removeEventListener(eventMap?: any, context?: any): TileLayer

Parameters

  • eventMap?: any optional
  • context?: any optional

Returns

TileLayer

public setOpacity(opacity: number): TileLayer

Changes the opacity of the tile layer.

Parameters

  • opacity: number

Returns

TileLayer

public setUrl(urlTemplate: string): TileLayer

Updates the layer's URL template and redraws it.

Parameters

  • urlTemplate: string

Returns

TileLayer

public setZIndex(zIndex: number): TileLayer

Sets the zIndex of the tile layer.

Parameters

  • zIndex: number

Returns

TileLayer