收藏
回答

提示 [渲染层错误] 实际第0元素的paths属性无效! 如何解决?

请教下:

我远程获取的polygon数组数据为:

{"q":1,"quyu":{"num":1,"latitude":"","longitude":"","detail":[{"points":[{"longitude":"114.343762","latitude":"30.627291","iconPath":"/image/t.png"},{"longitude":"114.352724","latitude":"30.621428","iconPath":"/image/t.png"},{"longitude":"114.354015","latitude":"30.620495","iconPath":"/image/t.png"},{"longitude":"114.356798","latitude":"30.618246","iconPath":"/image/t.png"},{"longitude":"114.358169","latitude":"30.616849","iconPath":"/image/t.png"},{"longitude":"114.359453","latitude":"30.615395","iconPath":"/image/t.png"},{"longitude":"114.360087","latitude":"30.614641","iconPath":"/image/t.png"},{"longitude":"114.360398","latitude":"30.614254","iconPath":"/image/t.png"},{"longitude":"114.362214","latitude":"30.611208","iconPath":"/image/t.png"},{"longitude":"114.363289","latitude":"30.607686","iconPath":"/image/t.png"},{"longitude":"114.320397","latitude":"30.596999","iconPath":"/image/t.png"},{"longitude":"114.32164","latitude":"30.598607","iconPath":"/image/t.png"},{"longitude":"114.32333","latitude":"30.600793","iconPath":"/image/t.png"},{"longitude":"114.325175","latitude":"30.603178","iconPath":"/image/t.png"},{"longitude":"114.327687","latitude":"30.606425","iconPath":"/image/t.png"},{"longitude":"114.338095","latitude":"30.619879","iconPath":"/image/t.png"},{"longitude":"114.340878","latitude":"30.623476","iconPath":"/image/t.png"},{"longitude":"114.343762","latitude":"30.627291","iconPath":"/image/t.png"}],"fillColor":"#FF0000AA","strokeWidth":3,"strokeColor":"#000000AA"}]}}

然后我输出数据绘制多边形:

that.setData({'polygons': res.data.quyu.detail });

但是没有正确绘制出图形,控制台报错如下:

请教各位朋友指点下这是哪里的问题,百思不得解。。。感谢。

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

3 个回答

  • Dreamer&&
    Dreamer&&
    2021-09-18

    我刚刚也遇到了这个问题,大概意思是至少需要两个点,一个点是不生效的。我写的是地图画轨迹,至少要两个坐标才能画出一条线,一个坐标只是点。绘制图相信也是这个问题。

    2021-09-18
    有用 1
    回复
  • 俪粒吖~
    俪粒吖~
    2021-04-12

    请问现在解决了吗

    2021-04-12
    有用
    回复
  • rice
    rice
    2020-12-17

    你好,解决了嘛,遇到同样问题

    2020-12-17
    有用
    回复 1
    • R
      R
      2021-01-15
      您好,您这边解决了嘛,我也遇到了同样的问题
      2021-01-15
      回复
登录 后发表内容
问题标签