Angular-google-maps: GoogleMapsAPIWrapper does not return from getNativeMap()

Created on 21 Oct 2016  路  9Comments  路  Source: SebastianM/angular-google-maps

The API call to promise GoogleMapsAPIWrapper.getNativeMap() does not seem to resolve or reject the promise.

constructor(private _wrapper: GoogleMapsAPIWrapper) {
    console.log('construtor');
    this._wrapper.getNativeMap().then((m) => {
      console.log('native map',m);
    }, err=>{
      console.log('error',err);
    })
  }

Here is a plunker
http://plnkr.co/edit/HCosbY?p=preview

Most helpful comment

Hi @smatthews1999 ,

I am still getting problem while calling

ngAfterViewInit() { this._wrapper.getNativeMap().then((m) => { console.log('native map',m); this._map = m; }, err=>{ console.log('error',err); }) }

I am not getting nativemap object.
This doesn't called anymore.
My angular version is : "angular2-google-maps": "^0.17.0"
Please any suggestion ?

All 9 comments

Hey @smatthews1999 - It's not a bug. You request a new instance of GoogleMapsAPIWrapper in your component (because its ouside of the map component).
I created a Plunker - with this structure, you get the instance of the map: http://plnkr.co/edit/KuHe8aqLS2sXj4wcADmV?p=preview

Thank you sir!

Unfortunately when I add the same directive to my component the call to this._wrapper.getNativeMap() does not resolve, or reject. I get no errors or no response.

What I don't get is that when I step into this call it looks like this... which does not look like a promise to me.
image

I have checked my version and have angular2-google-maps@^0.15.0

Got it! I had put my outside of the

Thanks again!

@SebastianM I copied your exact directive but rollup complains:

bundle failed: 'GoogleMapsAPIWrapper' is not exported by node_modules/angular2-google-maps/core/index.js

I'm building this with Ionic 2 if that's a concern.

What can be the problem?

@jonathan-chin Details for your error here: https://github.com/SebastianM/angular2-google-maps/pull/709#issuecomment-255429022 - It's fixed when we release a new version.

@SebastianM Do you have an ETA on the new release? is there a nightly version I can try?

Is there an old version where it works?

Sorry for the urgency. I want to have my code ready for when the issue is officially fixed.

Thanks!

Hi @smatthews1999 ,

I am still getting problem while calling

ngAfterViewInit() { this._wrapper.getNativeMap().then((m) => { console.log('native map',m); this._map = m; }, err=>{ console.log('error',err); }) }

I am not getting nativemap object.
This doesn't called anymore.
My angular version is : "angular2-google-maps": "^0.17.0"
Please any suggestion ?

It does not work for me either. I was trying to get the reference to native map object but this promise does not resolve at all.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vamsibassetty08 picture vamsibassetty08  路  3Comments

supran2811 picture supran2811  路  4Comments

alexweber picture alexweber  路  4Comments

Subhojit1992 picture Subhojit1992  路  3Comments

nthonymiller picture nthonymiller  路  4Comments