【类 型】:feat
【主 题】:地图组件 更改 【描 述】: [原因]:添加第三方 高德 地图接口 [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
d499b10b0d
commit
0c5a666b12
@ -17,7 +17,8 @@ export default {
|
|||||||
lngLats: [], // 航线 所有航点
|
lngLats: [], // 航线 所有航点
|
||||||
wayLngLats: [], // 航线 不包括起点航点
|
wayLngLats: [], // 航线 不包括起点航点
|
||||||
takeoffLngLats: [], // 航线 第一个航点 起点 最后一个航点
|
takeoffLngLats: [], // 航线 第一个航点 起点 最后一个航点
|
||||||
GoogleRasterStyle: {
|
// 地图样式
|
||||||
|
GoogleRasterStyle: { // mapbox官方样式 卫星地图
|
||||||
name: 'Mapbox Streets',
|
name: 'Mapbox Streets',
|
||||||
sprite: this.$store.state.settings.host + '/Public/map/sprite',
|
sprite: this.$store.state.settings.host + '/Public/map/sprite',
|
||||||
glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
|
glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
|
||||||
@ -31,8 +32,36 @@ export default {
|
|||||||
},
|
},
|
||||||
layers: [{ id: 'GoogleRasterLayer', type: 'raster', source: 'google' }]
|
layers: [{ id: 'GoogleRasterLayer', type: 'raster', source: 'google' }]
|
||||||
},
|
},
|
||||||
MapBoxglRasterStyle: 'mapbox://styles/mapbox/outdoors-v12',
|
MapBoxglRasterStyle: 'mapbox://styles/mapbox/outdoors-v12', // mapbox官方样式 矢量街道
|
||||||
MapBoxglSatellite: 'mapbox://styles/mapbox/satellite-streets-v12'
|
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: {
|
computed: {
|
||||||
@ -73,7 +102,7 @@ export default {
|
|||||||
// 'line-width': 1 // 设置等高线宽度
|
// 'line-width': 1 // 设置等高线宽度
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// 3纬度
|
// 3D地图
|
||||||
// this.map.addSource('mapbox-dem', {
|
// this.map.addSource('mapbox-dem', {
|
||||||
// type: 'raster-dem',
|
// type: 'raster-dem',
|
||||||
// url: 'mapbox://mapbox.mapbox-terrain-dem-v1',
|
// url: 'mapbox://mapbox.mapbox-terrain-dem-v1',
|
||||||
@ -117,7 +146,7 @@ export default {
|
|||||||
// 实例化map
|
// 实例化map
|
||||||
this.map = new mapboxgl.Map({
|
this.map = new mapboxgl.Map({
|
||||||
container: 'map',
|
container: 'map',
|
||||||
style: this.GoogleRasterStyle,
|
style: this.GaodeRasterStyle,
|
||||||
center: this.defaultLnglat,
|
center: this.defaultLnglat,
|
||||||
zoom: this.defaultZoom,
|
zoom: this.defaultZoom,
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user