Can't get google maps native to work

I have installed the google maps plugin like instructed, with valid keys.
My HTML has
<div #map class="map-wrapper" id="map" style="height:100%;"></div>

And my TS is:

  ngAfterViewInit() {
    alert();
    let element: HTMLElement = document.getElementById('map');

    let map: GoogleMap = this.googleMaps.create(element);
    map.one(GoogleMapsEvent.MAP_READY).then(() => alert('Map is ready!'));
}

The first alert fires, but the second alert doesn’t. The element is ok (console logged it, it shows the correct element), so I don’t know what I am missing.

I also tried on instead of once, with no luck.

There are no errors in console.

Anyone encountered this before?

(This is on an iOS emulator by the way)

This is Google Maps of Ionic Native or really ngCordova?

My bad with the category. This is Ionic native.

1 Like

Great. No experience myself, but the super starter uses a Google Map via Ionic Native. Maybe this can help: https://github.com/ionic-team/ionic-starter-super/tree/master/src/pages/map

1 Like

Thanks! I copied the code and it worked, so working backwards, the reason my code didn’t work, is that I did not moveCamera, so it just wasn’t ready.

1 Like