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

请问如何设置图层 #37

Open
ManonLoki opened this issue May 9, 2019 · 2 comments
Open

请问如何设置图层 #37

ManonLoki opened this issue May 9, 2019 · 2 comments

Comments

@ManonLoki
Copy link

看到ngx-amap 组件有@input() layers:any[]

但是我如何拿到AMap命名空间下的 Layers 并设置进去?
window["AMap"]获取的是Undefind
这个需求是因为我们需要用到实景图层

@xieziyu
Copy link
Owner

xieziyu commented May 14, 2019

@ManonLoki
需要使用AMap命名空间的话,需要等到ngx-amap组件(ready)事件通知以后使用。而且可以直接声明AMap并使用

declare const AMap: any;

demo中有一些使用AMap命名空间的例子,不过Layers目前没有完全包含在AMapClass里,所以声明成any吧

@ManonLoki
Copy link
Author

ManonLoki commented May 15, 2019 via email

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