From 8cd9c2ba162bf0fcef84308088f354c9f7c8552a Mon Sep 17 00:00:00 2001 From: tk Date: Wed, 24 Jul 2024 16:42:52 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afeat=20=E6=B7=BB=E5=8A=A0=E5=85=A8=E5=B1=8F=20?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F=20=E6=8E=A7=E4=BB=B6=20=E3=80=90=E5=8E=9F=20?= =?UTF-8?q?=20=E5=9B=A0=E3=80=91=EF=BC=9A=20=E3=80=90=E8=BF=87=20=20?= =?UTF-8?q?=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D?= =?UTF-8?q?=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- src/components/MapBox.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/MapBox.vue b/src/components/MapBox.vue index fa51d9c..3c447d2 100644 --- a/src/components/MapBox.vue +++ b/src/components/MapBox.vue @@ -154,8 +154,21 @@ export default { projection: 'globe' }) // 地图控件 - this.map.addControl(new mapboxgl.NavigationControl(), 'top-right') - this.map.addControl(new mapboxgl.ScaleControl(), 'top-right') + this.map.addControl(new mapboxgl.NavigationControl(), 'top-right')// 移动旋转指南针 + // this.map.addControl(new mapboxgl.ScaleControl(), 'top-right')// 地图比例 + this.map.addControl(new mapboxgl.FullscreenControl(), 'top-right')// 全屏 + // Add geolocate control to the map. + this.map.addControl( + new mapboxgl.GeolocateControl({ + positionOptions: { + enableHighAccuracy: true + }, + // When active the map will receive updates to the device's location as it changes. + trackUserLocation: true, + // Draw an arrow next to the location dot to indicate which direction the device is heading. + showUserHeading: true + }) + ) }, /** * @description: 清除地图上的航线