WMTSLayer
WMTS Layer, see the WMTS Standard
Example
Example Source Code
vue
<template>
<div style="height: 400px" class="vw-full vh-full">
<mb-map>
<mb-wmts-layer
url="http://t{s}.tianditu.gov.cn/img_w/wmts?tk=b8ed92ff9b64aebcb0110acca15e478f"
layer-name="img"
layer-style="default"
tile-matrimb-set-i-d="w"
subdomains="01234567"
:maxzoom="18"
/>
</mb-map>
</div>
</template>
<script setup lang="ts"></script>
API
PROPS
Name | Description | Type | Default |
---|---|---|---|
id | Layer ID. A unique identifier for the layer. | string | - |
layer-name | Layer name. The name of the layer as defined in the WMTS capabilities document. | string | - |
layer-style | Layer style. The style of the layer to be used, as defined in the WMTS capabilities document. | string | - |
tile-matrix-set-i-d | Tile Matrix Set ID. Identifies the Tile Matrix Set to be used for this layer, as defined in the WMTS capabilities document. This defines the tiling scheme (resolutions, scales, tile sizes, etc.). | string | - |
tile-size | Tile size in pixels. This defines the width and height of each tile. Typically 256 for standard WMTS. | number | 256 |
url | WMTS server URL. The base URL of the WMTS service endpoint. This URL is used to construct tile requests. | string | - |
format | Image format of the tiles. Common values include image/png , image/jpeg , and image/webp . | string | 'image/png' |
maxzoom | Maximum zoom level. The highest zoom level at which tiles are available. This corresponds to the highest resolution. | number | 22 |
minzoom | Minimum zoom level. The lowest zoom level at which tiles are available. This corresponds to the lowest resolution. | number | 0 |
show | Visibility of the layer. If true , the layer is displayed; if false , the layer is hidden. | boolean | true |
subdomains | Subdomains for the URL. This is used for load balancing by distributing tile requests across multiple subdomains. If provided, the URL will be templated with {s} where the subdomain should be inserted (e.g., http://{s}.example.com/wmts ). Can be a string or an array of strings. | string / string[] / number[] | - |
tile-matrix-prefix | Tile Matrix prefix. A prefix that may be added to the TileMatrix identifier in the tile URLs. This is sometimes required by certain WMTS implementations. | string | - |
extra-params | Extra parameters to be added to the tile URLs. These are additional query parameters that can be used to customize tile requests. The value should be a URL query string (e.g., "version=1.0.0&request=GetTile"). | string | - |
EVENTS
Name | Description | Parameters |
---|---|---|
created | Initialization complete event | - |
SLOTS
Name | Description |
---|
METHODS
Name | Description | Definition |
---|