From b90eebe6e09b0253c328fef1ee69e5345573fe00 Mon Sep 17 00:00:00 2001 From: xiaosi <2652281683@qq.com> Date: Wed, 26 Aug 2026 17:19:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9B=91=E6=8E=A7=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=9D=A1=E3=80=81=E6=AF=94=E4=BE=8B=E5=B0=BA?= =?UTF-8?q?=E4=B8=8E=E7=BB=91=E5=AE=9A=E8=99=9A=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支持卫星/矢量底图切换、fitAll、动态比例尺;选中飞行关系时绘制机巢到无人机虚线。 --- src/config/map.js | 24 +++++- src/styles/prototype.css | 1 + src/views/MonitorView/MonitorView.vue | 111 ++++++++++++++++++++++++-- 3 files changed, 129 insertions(+), 7 deletions(-) diff --git a/src/config/map.js b/src/config/map.js index 7730f03..214a927 100644 --- a/src/config/map.js +++ b/src/config/map.js @@ -9,7 +9,7 @@ export default { zoom: Number(import.meta.env.APP_MAP_ZOOM) || 5, } -/** 天地图影像 + 注记(WGS84 lk 系列) */ +/** 天地图影像/矢量 + 注记(Web 墨卡托 w 系列) */ export function createTiandituLayerOptions(tk) { return { img: { @@ -20,5 +20,27 @@ export function createTiandituLayerOptions(tk) { urlTemplate: `https://t{s}.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tk}`, subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], }, + vec: { + urlTemplate: `https://t{s}.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tk}`, + subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], + }, + cva: { + urlTemplate: `https://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tk}`, + subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], + }, + } +} + +export function createTiandituBaseLayer(maptalks, tk, mode = 'satellite') { + const layers = createTiandituLayerOptions(tk) + if (mode === 'street') { + return new maptalks.GroupTileLayer('tianditu-base', [ + new maptalks.TileLayer('tdt-vec', layers.vec), + new maptalks.TileLayer('tdt-cva', layers.cva), + ]) } + return new maptalks.GroupTileLayer('tianditu-base', [ + new maptalks.TileLayer('tdt-img', layers.img), + new maptalks.TileLayer('tdt-cia', layers.cia), + ]) } diff --git a/src/styles/prototype.css b/src/styles/prototype.css index 761535c..35d3678 100644 --- a/src/styles/prototype.css +++ b/src/styles/prototype.css @@ -175,6 +175,7 @@ svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: .binding-line text { fill: #fff; font-size: 2.4px; text-anchor: middle; paint-order: stroke; stroke: rgba(34,77,111,.88); stroke-width: .8px; } .map-view-all { height: 34px; padding: 0 10px; border-left: 1px solid var(--line); color: var(--blue); background: #fff; font-size: 11px; } .map-view-all:hover { background: #f3f8fc; } +.map-scale { position: absolute; z-index: 4; right: 12px; bottom: 14px; color: #fff; font-size: 10px; border-bottom: 2px solid #fff; padding: 0 16px 2px; text-shadow: 0 1px 3px #000; pointer-events: none; } @keyframes marker-pulse { 50% { filter: drop-shadow(0 0 6px rgba(204,61,67,.7)); } } .video-unavailable { color: var(--muted); font-size: 10px; } diff --git a/src/views/MonitorView/MonitorView.vue b/src/views/MonitorView/MonitorView.vue index 28d52c7..6a60119 100644 --- a/src/views/MonitorView/MonitorView.vue +++ b/src/views/MonitorView/MonitorView.vue @@ -162,11 +162,9 @@
- 天地图 - - - - + + +
@@ -175,6 +173,7 @@ 告警 离线
+
{{ mapScaleText }}