【类 型】:feat

【主	题】:地图组件 更改
【描	述】:
	[原因]:添加第三方 高德 地图接口
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
tk 2024-06-25 19:43:35 +08:00
parent d499b10b0d
commit 0c5a666b12

View File

@ -17,7 +17,8 @@ export default {
lngLats: [], // 线
wayLngLats: [], // 线
takeoffLngLats: [], // 线
GoogleRasterStyle: {
//
GoogleRasterStyle: { // mapbox
name: 'Mapbox Streets',
sprite: this.$store.state.settings.host + '/Public/map/sprite',
glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
@ -31,8 +32,36 @@ export default {
},
layers: [{ id: 'GoogleRasterLayer', type: 'raster', source: 'google' }]
},
MapBoxglRasterStyle: 'mapbox://styles/mapbox/outdoors-v12',
MapBoxglSatellite: 'mapbox://styles/mapbox/satellite-streets-v12'
MapBoxglRasterStyle: 'mapbox://styles/mapbox/outdoors-v12', // mapbox
MapBoxglSatellite: 'mapbox://styles/mapbox/satellite-streets-v12', // mapbox
GaodeVectorStyle: { //
name: 'Gaode Vector',
sprite: this.$store.state.settings.host + '/Public/map/sprite',
glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
version: 8,
sources: {
gaode: {
type: 'raster',
tileSize: 256, // 256 512
tiles: ['http://wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}']
}
},
layers: [{ id: 'GaodeVectorLayer', type: 'raster', source: 'gaode' }]
},
GaodeRasterStyle: { //
name: 'Gaode Raster',
sprite: this.$store.state.settings.host + '/Public/map/sprite',
glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
version: 8,
sources: {
gaode: {
type: 'raster',
tileSize: 256, // 256 512
tiles: ['https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}']
}
},
layers: [{ id: 'GaodeRasterLayer', type: 'raster', source: 'gaode' }]
}
}
},
computed: {
@ -73,7 +102,7 @@ export default {
// 'line-width': 1 // 线
// }
// })
// 3
// 3D
// this.map.addSource('mapbox-dem', {
// type: 'raster-dem',
// url: 'mapbox://mapbox.mapbox-terrain-dem-v1',
@ -117,7 +146,7 @@ export default {
// map
this.map = new mapboxgl.Map({
container: 'map',
style: this.GoogleRasterStyle,
style: this.GaodeRasterStyle,
center: this.defaultLnglat,
zoom: this.defaultZoom,
pitch: 0,