Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WmtsLayerCollection

Class containing several Wmts layers. Basic methods for adding and deleting them.

Url should be formatted with {x}, {y} and {z}:

{
     url: 'https://lbsva.telcel.com/tiles/gwc/service/wmts?layer=telcel:cincog_no_garantizada&style=&tilematrixset=EPSG:900913&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/png&TileMatrix=EPSG:900913:{z}&TileCol={x}&TileRow={y}'
}

How to use the WMTS layer interfaces and clases.

// WMTS layer to be used for testing
const wmtsLayer: IWmtsLayer = {
     id: '102',
     url: 'https://lbsva.telcel.com/tiles/gwc/service/wmts?layer=telcel:cincog_no_garantizada&style=&tilematrixset=EPSG:900913&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/png&TileMatrix=EPSG:900913:{z}&TileCol={x}&TileRow={y}'
};

// Creates a WMTS layer collection
const wmtsLayerCollection: WmtsLayerCollection = new WmtsLayerCollection();

// Adds a WMTS Layer to the collection.
wmtsLayerCollection.addWmtsLayer(wmtsLayer);

// Sets the visibility of a WMTS layer from the collection.
// This method is optimal for scenarios where you set and unset over and over the same WMTS layer.
wmtsLayerCollection.removeById('102', true);

// Removes a WMTS layer from the collection
wmtsLayerCollection.removeById('102');

Hierarchy

  • WmtsLayerCollection

Index

Accessors

wmtsLayers

Methods

addWmtsLayer

  • Adds a wmts layer to the collection. If exists already, sets the visibility of the layer.

    Parameters

    • wmtsLayer: IWmtsLayer

      WmtsLayer to be added be added

    Returns void

addWmtsLayers

  • Adds multiple wmts layers to the collection.

    Parameters

    • wmtsLayers: IWmtsLayer[]

      Wmts layers array to be added.

    Returns void

removeAll

  • removeAll(): void
  • Removes all wmts layers at once.

    Returns void

removeById

  • removeById(wmtsLayerId: string): boolean
  • Removes a wmts layer from the collection by Id.

    Parameters

    • wmtsLayerId: string

      Wmts layer id to be removed.

    Returns boolean

setVisibility

  • setVisibility(wmtsLayerId: string, visible: boolean): void
  • Sets the visibility of a WMTS layer.

    Parameters

    • wmtsLayerId: string

      The id of the WMTS layer for which the visibility will be set.

    • visible: boolean

      Indicates if the WMTS layer will be visible or not.

    Returns void

Generated using TypeDoc