收藏
回答

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;

}

}

})

}

回答关注问题邀请回答
收藏

1 个回答

  • Demons
    Demons
    2023-07-18

    请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    2023-07-18
    有用
    回复
登录 后发表内容