antvis / L7Draw

L7 绘制控件

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐛 [BUG] DrawPoint 图片显示异常

zoffyzhang opened this issue · comments

🐛 Bug description [Please make everyone to understand it]

Please provide a link by forking these links L7 Draw or GitHub repo, a minimal reproduction.

  • Required Link to minimal reproduction:

📷 Step to reproduce

把官方例子 docs/example/point/image.tsx 中的图片链接替换为其他图片,如 https://gw.alipayobjects.com/zos/antfincdn/tWx6gaMr9P/zhongguoyinhang.png
绘制出来的点显示异常

image

🏞 Expected result

🚑 Any additional [like screenshots]

  • L7Draw Version:
  • Platform:

因为这个示例中对 PNG 图片的颜色进行了覆盖,如果使用你提供的图片进行绘制的话,得通过 callback 把 color 配置关掉

      const drawer = new DrawPoint(scene, {
        style: {
          point: {
            normal: { shape: 'dingwei', size: 10, color: undefined },
            hover: { shape: 'dingwei', size: 20, color: undefined },
            active: { shape: 'dingwei', size: 20 },
            callback: ([layer]: ILayer[]) => {
              layer.color(undefined);
            },
          },
        },
      });