MapboxTiandituLayer
以天地图 WMTS 瓦片作底图,支持矢量/影像/地形及对应注记叠加。
简介
MapboxTiandituLayer 以天地图 WMTS 瓦片作底图:layer 选类型(vec 矢量 / img 影像 / ter 地形,及注记 cva/cia/cta),annotation 叠加对应注记层,tk 缺省时回退运行时配置的 tiandituToken。
天地图为 GCJ02 坐标系,叠加自有 WGS84 数据时先经 坐标转换 对齐。
用法
切换 layer 查看矢量/影像/地形底图(均叠加注记):
<script setup lang="ts">
withDefaults(
defineProps<{
layer?: 'vec' | 'img' | 'ter'
annotation?: boolean
}>(),
{
layer: 'vec',
annotation: true
}
)
</script>
<template>
<div class="h-115 w-full overflow-hidden rounded-(--ui-radius) border border-default">
<MapboxMap
:options="{ style: 'mapbox://styles/mapbox/empty-v9', center: [116.397, 39.908], zoom: 10 }"
>
<MapboxTiandituLayer :layer="layer" :annotation="annotation" />
</MapboxMap>
</div>
</template>
API
Props
| Prop | Default | Type |
|---|---|---|
layer | 'vec' | "vec" | "img" | "ter" | "cva" | "cia" | "cta"天地图图层类型(vec 矢量底图) |
tk | string天地图 token;缺省时回退运行时配置 | |
beforeId | string插入到该图层之前 | |
annotation | false | boolean叠加对应注记图层(vec→cva / img→cia / ter→cta) |
Changelog
No recent changes