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

关于iclient-openlayers下面的MapExtend.js #26

Closed
llf-yuanchen opened this issue Sep 18, 2018 · 2 comments
Closed

关于iclient-openlayers下面的MapExtend.js #26

llf-yuanchen opened this issue Sep 18, 2018 · 2 comments
Assignees

Comments

@llf-yuanchen
Copy link

Request a feature or report a bug? [这是一个需求还是一个缺陷]

bug

One-line summary [问题简述]

当我的layer是放在openlayers提供的LayerGroup里面的时候,this.getLayers().getArray()返回的不是一个ol.layer.Base,而是一个LayerGroup,这个时候后面的一系列都会报错,望及时处理修复

Version [产品及版本]

  • iClient product (for leaflet,for openlayers,for mapboxgl,classic)[iClient 产品]:openlayers
  • iClient version [iClient 版本]:9.1.0-beta
  • Browser version [浏览器类型和版本]:
  • OS Version [操作系统类型和版本]:

Actual Behavior [当前现象]

Expected Behavior [期望现象]

Example of reproducing the issue [重现现象的例子]


What is motivation or use case for changing the behavior? [需求的场景和目的是什么?]

@songyumeng
Copy link
Member

谢谢您报的缺陷,可以提供一个简单的例子重现该问题吗?

@llf-yuanchen
Copy link
Author

image

就是这里,如果在openlayers中使用了ol.layer.Group来对图层进行分组添加,在鼠标在地图上移动时会跳到这里,提示
image

是因为layers = this.getLayers().getArray();里面还会存在ol.layer.Group; ol.layer.Group.getLayers()才会取到里面的所有layer,才能去调用getSource();
所以这里希望能够完善一下,在这里我临时处理的方法是这样的
img

可能只是针对这种情况做的特殊处理,不知道在openlayers里面这一块还有没有其他特殊情况,还请处理完善

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

3 participants