interes_ting
interes_ting
  • 发布:2020-04-16 11:01
  • 更新:2021-10-21 12:00
  • 阅读:927

translateMarker 的duration不可以根据设置的播放倍速而变化吗?

分类:uni-app

语言不太好描述,直接给大家看gif把

如果我暂停,车辆轨迹会停止 但是车(marker)会继续走,知道走到车辆轨迹停止的地方才会停止

正常情况下,不是应该车跟随着车辆轨迹一起走吗?

我把车的倍速 赋值给 车(marker)的 duration,但是还是不行

这个 车(marker)好像有自己的想法

/ 速度选择  
        PickerChange: function(e) {  
            var that = this;  
            if (e.detail.value <= 0) {  
                e.detail.value = 0;  
            }  
            that.index = e.detail.value;  
            if (that.index == 0) {  
                that.doubleSpeed = 1000;  
                that.butn = 0;  
                clearInterval(that.timer);  
            } else if (that.index == 1) {  
                that.doubleSpeed = 500;  
                that.butn = 0;  
                clearInterval(that.timer);  
            } else if (that.index == 2) {  
                that.doubleSpeed = 100;  
                that.butn = 0;  
                clearInterval(that.timer);  
            }  

        },  
//播放  
        carPlay: function() {  
            var that = this;  
            console.log(that.doubleSpeed);  
            if (that.butn === 0) {  
                that.butn = 1;  
            }  
            if (!that.carFlager) {  
                that.polyline[1].points = [];  
                that.markers[0].latitude =  that.polyline[0].points[0].latitude;  
                that.markers[0].longitude =  that.polyline[0].points[0].longitude;  
                that.i = 0;  
                that.numItem = 0;  
                that.progress = 0;  

            }else {  
                that.i = that.timeI   
            }  

            clearInterval(that.timer);  
            let item = that.polyline[0].points;  
            // 进度  
            let allProgress = 100;  
            let allte = 100 / that.polyline[0].points.length;  
            that.timer = setInterval(function(){  
                that.carMap.translateMarker({  
                    markerId: that.markers[0].id,  
                    // 速度  
                    duration:this.doubleSpeed,  
                    // duration:0,  
                    // 指定 marker 移动到的目标点  
                    destination: {  
                        longitude: that.polyline[0].points[that.i].longitude,  
                        latitude: that.polyline[0].points[that.i].latitude  
                    },  
                    // 自动旋转  
                    autoRotate: false,  
                    // 旋转角度  
                    rotate: that.mapList[that.i].directionDegrees,  

                });  
                that.latitude = that.polyline[0].points[that.i].latitude;  
                that.longitude = that.polyline[0].points[that.i].longitude;  
                that.info = [that.mapList[that.i]];  
                that.carspeed = that.info[0].speed;  
                that.carTime = that.info[0].address;  
                that.polyline[1].color = '#1e83ff';  
                that.polyline[1].points.push(item[that.numItem]);  
                that.progress = allte + that.progress;  
                that.i++;  
                that.timeI = that.i  
                that.numItem++;  

                if (that.numItem >= item.length) {  
                    that.numItem = 0;  
                    that.butn = 0;  
                    that.carFlager = false;  
                    that.carMap.includePoints({  
                        points: that.polyline[0].points,  
                        padding: [30, 20, 20, 30],  
                        success: function(res) {  

                        }  
                    });  
                    clearInterval(that.timer);  
                    return;  
                }  

            }, that.doubleSpeed);  
        },  

求助大佬们,这个是什么原因啊?微信官方文档也没有详细的说明

2020-04-16 11:01 负责人:无 分享
已邀请:
不光头的程序猿

不光头的程序猿

大佬,请问你这ranslateMarker 设置旋转角度是后台返给你的角度嘛,角度方向卡在这一块了,请求大佬帮忙感谢

花间寻酒

花间寻酒

你好,你这个问题解决了吗,我也卡在这儿了

  • 花间寻酒

    设置了倍速播放,但是marker的移动速度没有一点变化

    2021-10-21 12:01

  • 不光头的程序猿

    使用原生插件

    吧,不然解决不了的。

    2021-12-20 11:07

该问题目前已经被锁定, 无法添加新回复