详细问题描述
[内容]
地图控制方法里的 translateMarker 方法报错。
在使用translateMarker时会提示
TypeError: Cannot read property 'length' of undefined
08:12:03.913 13:02.766 30043 30043 I console : at uniapp://ready:155:16317
08:12:03.933 13:02.766 30043 30043 I console : at Object.x (uniapp://ready:145:2097)
08:12:03.953 (uniapp://ready:1:14521)
08:12:04.008 Uncaught TypeError: Cannot read property 'length' of undefined at uniapp://ready:155
以下是我的部分代码
onReady: function (res) {
this.map = uni.createMapContext('myMap');
}
that.map.translateMarker({
markerId:2,
destination:{
latitude:lat,
longitude:lng
},
autoRotate:false,
rotate:0
});
sampen
这个问题现在修复了没有,还是一直报错。
2018-11-08 15:01
UserX
我现在用移动marker来实现轨迹回放,translateMarker方法进入不了suncess的回调函数,而且图标消失
this.mapContext = uni.createMapContext('myMap');
this.destinationPoint.push({longtitude:this.$data.traceData[this.$data.pointsIndex][0],latitude:this.$data.traceData[this.$data.pointsIndex][1]});
Vue.set(this.$data.destinationPoint[this.$data.pointsIndex],'longitude',this.$data.traceData[this.$data.pointsIndex][0]);
Vue.set(this.$data.destinationPoint[this.$data.pointsIndex],'latitude',this.$data.traceData[this.$data.pointsIndex][1]);
pointsIndex++;
this.mapContext.translateMarker({
markerId:1,
destination:this.$data.destinationPoint,
autoRotate:false,
rotate:1,
duration:1000,
animationEnd:function(){
startAnimation(pointsIndex);
console.log("移动移动结束");
},
fail:function(e){
console.log("来了老弟");
console.log(e);
}
});
2019-03-05 15:03