mapp.layer.formats.tiles()

This module defines the tiles format for map layers.

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
layerObject

The layer object.

Properties
NameTypeAttributesDefaultDescription
sourcestring<optional>
'OSM'

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

projectionstring<optional>
'EPSG:3857'

The projection of the tile layer.

paramStringstring<optional>

The parameter string for the tile layer URL.

paramsObject<optional>

Additional parameters for the tile layer.

URIstring

The base URI for the tile layer.

styleObject<optional>

The style configuration for the layer.

zIndexnumber<optional>
0

The z-index of the layer.

Lol.layer.Tile

The OpenLayers tile layer object.