Class TileLayer

Hierarchy

Index

Constructor methods

Methods

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 getTileJSON(): any

Returns this layer's TileJSON object which determines its tile source, zoom bounds and other metadata.

Returns

any

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 setFormat(format: string): TileLayer

Set the image format of tiles in this layer. You can use lower-quality tiles in order to load maps faster

Parameters

  • format: string

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