【类 型】:feat 添加全屏 跟随 控件
【原 因】: 【过 程】: 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
747a2cf34e
commit
8cd9c2ba16
@ -154,8 +154,21 @@ export default {
|
|||||||
projection: 'globe'
|
projection: 'globe'
|
||||||
})
|
})
|
||||||
// 地图控件
|
// 地图控件
|
||||||
this.map.addControl(new mapboxgl.NavigationControl(), 'top-right')
|
this.map.addControl(new mapboxgl.NavigationControl(), 'top-right')// 移动旋转指南针
|
||||||
this.map.addControl(new mapboxgl.ScaleControl(), '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: 清除地图上的航线
|
* @description: 清除地图上的航线
|
||||||
|
Loading…
Reference in New Issue
Block a user