【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
基于uniapp微信小程序轨迹回放
基于 translateMarker
实现轨迹回放功能
代码如下:
let mapContext = uni.createMapContext('map', this);
mapContext.translateMarker({
//需要移动点的id
markerId: this.markers[0].id,
//需要移动的经纬度
destination: {
longitude: 126.542111,
latitude: 45.711007,
},
//自动方向(实际项目中测试不好用)
autoRotate: false,
//方向角
rotate: 50,
//动画速度
duration: 1000,
animationEnd: function() {
console.log(123)
},
fail(e) {
console.log(e)
}
})
来源:oschina
链接:https://my.oschina.net/lwenhao/blog/3147757