【类 型】:factor 平移方法 增加上下漂移
【原 因】:飞机控制栏放到底部 点击时需要配合地图上移 【过 程】:加一个参数 x 横移 y纵移 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
d7730c5893
commit
074996f51f
@ -154,8 +154,8 @@ 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(), 'bottom-left')
|
||||
},
|
||||
/**
|
||||
* @description: 清除地图上的航线
|
||||
@ -486,11 +486,12 @@ export default {
|
||||
})
|
||||
},
|
||||
/**
|
||||
* @description: 屏幕横移
|
||||
* @param {*} val 正数向左移动 负数向右移动
|
||||
* @description: 屏幕横移 纵移
|
||||
* @param {*} x 正数向左移动 负数向右移动
|
||||
* @param {*} y 正数向上移动 负数向下移动
|
||||
*/
|
||||
mapXOffset (val) {
|
||||
this.map.panBy([val, 0], {
|
||||
mapXOffset (x, y) {
|
||||
this.map.panBy([x, y], {
|
||||
duration: 333 // 过渡持续时间,以毫秒为单位
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user