# Angular2-google-maps in ionic 2

**URL:** <https://forum.ionicframework.com/t/angular2-google-maps-in-ionic-2/65736>\
**Category:** ionic-v3\
**Created:** [October 4, 2016, 1:28pm UTC](https://forum.ionicframework.com/t/angular2-google-maps-in-ionic-2/65736 "2016-10-04T13:28:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![modularcoder](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/modularcoder/32/103648_2.png) [@modularcoder](https://forum.ionicframework.com/u/modularcoder)\
**Post date:** [October 4, 2016, 1:28pm UTC](https://forum.ionicframework.com/t/angular2-google-maps-in-ionic-2/65736/1 "2016-10-04T13:28:09Z")

</div>

Hi all!

I’m trying to setup angular2-google-maps component for ionic2 app, but getting error on build.

```
ngc error: Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in E:/node/hotby.me/ionic2-angular2-google-maps-example/.tmp/app/app.module.ts, resolving symbol AppModule in E:/node/hotby.me/ionic2-angular2-google-maps-example/.tmp/app/app.module.ts

```

Can someone help me please?

Here is the module definition file

> <https://github.com/modularcoder/ionic2-angular2-google-maps-example/blob/master/src/app/app.module.ts>

And here is full project repo, which is just ionic2 blank template with modified app.module.ts fil

> **[modularcoder/ionic2-angular2-google-maps-example](https://github.com/modularcoder/ionic2-angular2-google-maps-example)**
>
> ionic2-angular2-google-maps-example - Example of angula2-google-maps component usage in ionic2

---

<div class="post-metadata">

**Author:** ![modularcoder](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/modularcoder/32/103648_2.png) [@modularcoder](https://forum.ionicframework.com/u/modularcoder)\
**Post date:** [October 6, 2016, 10:37am UTC](https://forum.ionicframework.com/t/angular2-google-maps-in-ionic-2/65736/2 "2016-10-06T10:37:11Z")

</div>

Ok, I’ve finally managed to run the angular2-google-maps in my app.

The issue was is caused by Angular2 ahead of time compiler and angular2-google maps incompatibility.  
If anyone will have same issue, here are the steps I’ve done, to make it work in dev environment without AoT

1. I’ve updated ionic build scripts lib, so now it doesn’t make AoT compiling for dev build

2. You need to import angular2-google-maps by following method, otherwise it doesn’t work after rollup

3. Add the AgmCoreModule to imports field in your app module

Now you’ll to be able to use the   
This works only for build in dev environment yet, untill angular2-google-maps plugin will add AoT support.

Regards  
Gevorg

---

<div class="post-metadata">

**Author:** ![DeeM52](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/deem52/32/101606_2.png) [@DeeM52](https://forum.ionicframework.com/u/DeeM52)\
**Post date:** [October 6, 2016, 8:09pm UTC](https://forum.ionicframework.com/t/angular2-google-maps-in-ionic-2/65736/3 "2016-10-06T20:09:31Z")

</div>

> [@modularcoder](#):
>
> I’ve updated ionic build scripts lib, so now it doesn’t make AoT compiling for dev build

Isn’t there a way to configure rollup so that AoT compiling is not applied on modules which don’t have support for AoT?

---

<div class="post-metadata">

**Author:** ![modularcoder](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/modularcoder/32/103648_2.png) [@modularcoder](https://forum.ionicframework.com/u/modularcoder)\
**Post date:** [October 6, 2016, 9:26pm UTC](https://forum.ionicframework.com/t/angular2-google-maps-in-ionic-2/65736/4 "2016-10-06T21:26:08Z")

</div>

That’s an interesting question. I don’t know, but I think that rollup has nothing to do with AoT, and the error is given during **ngc** task, which is **AoT** compilation task, and rollup comes after in **bundle** task

> <https://github.com/ionic-team/ionic-app-scripts/blob/master/src/build.ts>

I may be wrong though.

---

<div class="post-metadata">

**Author:** ![osi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/osi/32/101265_2.png) [@osi](https://forum.ionicframework.com/u/osi)\
**Post date:** [October 6, 2016, 9:43pm UTC](https://forum.ionicframework.com/t/angular2-google-maps-in-ionic-2/65736/5 "2016-10-06T21:43:03Z")

</div>

There is a actually an issue open for AoT support at: [https://github.com/SebastianM/angular2-google-maps/issues/629](https://github.com/SebastianM/angular2-google-maps/issues/629) on which you might want to keep an eye on.
