/layer/formats/tiles
The module exports the "tiles" format method for the Mapp layer decorator method.
- Source
Methods
(inner) tiles(layer)
The function takes a layer object as input and performs the following steps:
- It sets default values for
layer.sourceandlayer.projectionif they are not already defined. - It creates a parameter string (
layer.paramString) using themapp.utils.paramStringfunction, passinglayer.paramsas an argument. - It creates a new
ol.layer.Tileobject and assigns it tolayer.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 usingol.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:
Properties| Name | Type | Description |
|---|---|---|
layer | layer | The layer object. |
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
layer.source | string | <optional> | 'OSM' | The source of the tile layer (e.g., 'OSM', 'XYZ'). |
layer.projection | string | <optional> | 'EPSG:3857' | The projection of the tile layer. |
layer.paramString | string | <optional> | The parameter string for the tile layer URL. | |
layer.params | Object | <optional> | Additional parameters for the tile layer. | |
layer.URI | string | The base URI for the tile layer. | ||
layer.style | Object | <optional> | The style configuration for the layer. | |
layer.zIndex | number | <optional> | 0 | The z-index of the layer. |
layer.L | ol. | The OpenLayers tile layer object. |
- Source