xieziyu / ngx-amap

angular 2+ component for AMap (Gaode map)
https://xieziyu.github.io/ngx-amap
MIT License
148 stars 42 forks source link

ionic3 的工程报错 #22

Open oceankai opened 6 years ago

oceankai commented 6 years ago

您好,我在ionic3的工程中使用这个地图插件,地图显示和坐标获取均没有问题。但是,在地图的HTML中放入任何属性都会报错: MapPage.html:21 ERROR TypeError: Object(...) is not a function at ChangeFilter.has (ngx-amap.js:891) at AmapMarkerDirective.ngOnChanges (ngx-amap.js:2399) at checkAndUpdateDirectiveInline (core.js:12407) at checkAndUpdateNodeInline (core.js:13935) at checkAndUpdateNode (core.js:13878) at debugCheckAndUpdateNode (core.js:14771) at debugCheckDirectivesFn (core.js:14712) at Object.eval [as updateDirectives] (MapPage.html:21) at Object.debugUpdateDirectives [as updateDirectives] (core.js:14697) at checkAndUpdateView (core.js:13844)

使用如下: <ngx-amap class="demo-map" [zoom]='13'>< / ngx-amap>

请问,需要如何解决这个问题,谢谢

xieziyu commented 6 years ago

@oceankai 请提供一下项目依赖的: angular的版本号和ngx-amap的版本号?

oceankai commented 6 years ago

您好,版本号如下: Angular CLI: 1.7.1 Node: 6.11.0 OS: darwin x64 "ngx-amap": "^2.0.0",

谢谢

xieziyu commented 6 years ago

@oceankai 还是没有提供Angular的版本号,但是看你CLI版本是1.7的话,可以估计Angular的版本是低于6.0的。所以请使用ngx-amap的1.3.2版本

oceankai commented 6 years ago

好的,我试一下,谢谢