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

热力图数据不能为空 #162

Closed
photino opened this issue Jan 15, 2020 · 3 comments
Closed

热力图数据不能为空 #162

photino opened this issue Jan 15, 2020 · 3 comments

Comments

@photino
Copy link

photino commented Jan 15, 2020

  • L7 Version: 2.0.0

  • Platform: Windows

  • Mini Showcase(like screenshots):
    image

  • CodePen Link:

如果HeatmapLayer传入的data为空数组,会报错TypeError: Cannot read property 'filter' of undefined

@lzxue
Copy link
Contributor

lzxue commented Jan 18, 2020

  • L7 Version: 2.0.0
  • Platform: Windows
  • Mini Showcase(like screenshots):
    image
  • CodePen Link:

如果HeatmapLayer传入的data为空数组,会报错TypeError: Cannot read property 'filter' of undefined

提供一下具体的data配置项

@photino
Copy link
Author

photino commented Jan 18, 2020

就是传的data为[],因为这个是后台提供的,有时会为空,最好数据为空时不渲染图层就行,但是不能报错

@lzxue
Copy link
Contributor

lzxue commented Jan 19, 2020

geojson 需要传入geojson

layer
      .source({
        type: 'FeatureCollection',
        features: [],
      })

2.0.5 版本已修复

@lzxue lzxue closed this as completed Jan 19, 2020
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

2 participants