/layer/formats/tiles

The module exports the "tiles" format method for the Mapp layer decorator method.

Methods

(inner) tiles(layer)

The function takes a layer object as input and performs the following steps:

  1. It sets default values for layer.source and layer.projection if they are not already defined.
  2. It creates a parameter string (layer.paramString) using the mapp.utils.paramString function, passing layer.params as an argument.
  3. It creates a new ol.layer.Tile object and assigns it to layer.L. The tile layer is configured with the following properties:
    • source: A new instance of the tile source based on layer.source. The source is created using ol.source[layer.source] and is configured with the projection, url, and transition properties.
    • layer: The layer object itself, allowing access to layer properties within the tile layer.
    • zIndex: The z-index of the layer.
Parameters:
NameTypeDescription
layerlayer

The layer object.

Properties
NameTypeAttributesDefaultDescription
layer.sourcestring<optional>
'OSM'

The source of the tile layer (e.g., 'OSM', 'XYZ').

layer.projectionstring<optional>
'EPSG:3857'

The projection of the tile layer.

layer.paramStringstring<optional>

The parameter string for the tile layer URL.

layer.paramsObject<optional>

Additional parameters for the tile layer.

layer.URIstring

The base URI for the tile layer.

layer.styleObject<optional>

The style configuration for the layer.

layer.zIndexnumber<optional>
0

The z-index of the layer.

layer.Lol.layer.Tile

The OpenLayers tile layer object.