杨大宝
杨大宝
  • 发布:2018-08-16 08:27
  • 更新:2020-10-20 11:18
  • 阅读:3117

【报Bug】translateMarker 无效老报错

分类:uni-app

详细问题描述
[内容]
地图控制方法里的 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
});

2018-08-16 08:27 负责人:无 分享
已邀请:
Neil_HL

Neil_HL

已重现该问题,我们会尽快修复

  • 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

boto

boto - uniapp爱好者

现在这个可以用了吗,我的报这个错误:
TypeError: Cannot read property 'map' of undefined

UserX

UserX - Chaser

现在这个问题解决了么?我的不在控制台报错,我查看参数时看到了TypeError报错,我定义了两个点,明明有距离,但是它的length为0

1***@qq.com

1***@qq.com

1.9.2版本又不行了

  • 1***@qq.com

    我的问题已经解决

    2019-05-23 11:38

1***@qq.com

1***@qq.com

现在还是不能,success和fail都不走

1***@qq.com

1***@qq.com

我的 现在还是不能,success和fail都不走

j***@163.com

j***@163.com

2020年10月20日 nvue 使用translateMarker 无效,即marker位置不会变

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

  • 标题 / 粗斜体
  • 代码片段
  • 超链接 / 图片 / 视频
  • 列表 / 引用

文章内容较多时,可以用标题分段 :

## 大标题 
### 小标题

斜体 / 粗体 :

**粗体** 
*斜体*
***粗斜体***

代码片段 :

``` javascript
代码片段
```

超链接 :

[链接文字](链接地址) 例: [百度](http://www.baidu.com)

图片 :

![图片说明](图片地址) 例: ![百度logo](http://www.baidu.com/img/bdlogo.gif)

视频 :

!![视频说明](视频地址) 例: !![优酷视频](http://youku.com)

有序列表 :

1. 123
2. 123
3. 123

无序列表 :

- 123
- 123
- 123

引用 : ( 双回车后结束引用 )

> 引用内容
引用内容
引用内容