Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

单页面应用,调用这个方法后,mapvLayer.destroy();或者mapvLayer.hide(); 再new mapv.baiduMapLayer生成新的对象,click时会报错,Cannot read property 'canvas' of null #261

Open
shiliangL opened this issue Aug 13, 2021 · 3 comments

Comments

@shiliangL
Copy link

image
image

@yangdong520
Copy link

全是bug 真的老老实实用原生态,或者直接放弃百度

@jawn-ha
Copy link

jawn-ha commented Aug 7, 2022

解决了吗?遇到同样的问题

@vaebe
Copy link

vaebe commented Sep 7, 2023

目前使用的解决办法时,数据更新时不销毁图层。而是通过 dataset.set 方式设置新的数据

数据更新好像确实不应该销毁图层

//  不存在则创建, 存在则设置为新的值
  if (!baiduMapLayerData.value) {
    baiduMapLayerData.value = new DataSet(pointList)
  } else {
    baiduMapLayerData.value.set(pointList)
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants