遇到同样的问题,博主解决了吗
translateMarker在vue3调用无效,都没有success fail complete?onReady(()=>{ // 创建map对象 map.value = uni.createMapContext('map'); // 获取屏幕高度 uni.getSystemInfo({ success: res => { windowHeight.value = res.windowHeight; } }); }) function start() { isStart.value = true; isDisabled.value = true; let data = coordinate.value; let len = data.length; let datai = data[playIndex.value]; console.log(map.value,2222) map.value.translateMarker({ markerId: 1, autoRotate:true, rotate:10, destination: { longitude: datai.longitude, // 车辆即将移动到的下一个点的经度 latitude: datai.latitude, // 车辆即将移动到的下一个点的纬度 }, duration: 700, success(){ console.log(898989) }, fail(){ console.log(33333) }, complete(){ console.log(3333) playIndex.value++; if(playIndex.value < len){ start(playIndex.value, data); }else{ console.log('okokok'); uni.showToast({ title: '播放完成', duration: 1400, icon: 'none' }); playIndex.value = 0; isStart.value = false; isDisabled.value = false; } }, animationEnd(){ console.log(4444) // 轨迹回放完成 处理H5端 playIndex.value++; if(playIndex.value < len){ start(playIndex.value, data); }else{ console.log('okokok'); uni.showToast({ title: '播放完成', duration: 1400, icon: 'none' }); playIndex.value = 0; isStart.value = false; isDisabled.value = false; } } }) }
10-24