Google Maps Native not Working

Well I did another check with your suggestions and now the app is not just a white screen
Now it has the ion-nav-bar
But where the map should be is just a black screen.

Any ideas?

  1. You should enable debugger to see if there are any errors.

2.also check that you are using IOS sdk API key, javascript api key wont work

3.try to uninstal plugin and install it again

Well i guess I found out what the issue is, sort of.

Finnally got a white screen again but with the nav bar.
And on the console i do see the Map is ready! log.
And on the Google Console, i do get the request.
So the map is loading somewhere.

So with the safari inspect i look at the propertys.
and well trying to figure out i unchecked a css property and puff the maps showed!
I thought it was a particular property, but it seemed to work with any property I uncheck,
even if it was not from the map div
The map is there, but it seems like the css has a white screen in front, or it dosnt load correctly.

I’ve try with this two hacks i found on github

ion-nav.has-views {
background-color: transparent !important;

ion-app.gmaps_cdv .nav-decor{
background-color: transparent !important;

But none seems to solve the problem, even tried this

ionViewWillEnter(): void {
document.getElementsByClassName(‘nav-decor’)[2].className += ’ hide’;
document.getElementsByClassName(‘nav-decor’)[3].className += ’ hide’;

ionViewWillLeave(): void {
document.getElementsByClassName(‘nav-decor’)[2].className = ‘nav-decor’;
document.getElementsByClassName(‘nav-decor’)[3].className = ‘nav-decor’;

Found in here

But it just seem is a too old fix.

Any ideas?

I think it might be opacity.

This is my css, works for Javascript API and Android native plugin, didn’t test on IOS. Some of it may be old artifacts from previous tries :slight_smile:

 #map_canvas {
      width: 100%;
      height: 100%;
      transition: opacity 150ms ease-in
    } {
      opacity: 1;

    ion-app._gmaps_cdv_ .nav-decor{
      background-color: transparent !important;

    .show-map {
      opacity: 1;
1 Like

See my basic Google Map component here:

Try This and no luck.

Well now I still on this point


ion-nav.has-views {
  background-color: transparent !important;


ion-app._gmaps_cdv_ .nav-decor{
  background-color: transparent !important;

page-home {

  #map {
    height: 100%;



constructor(public navCtrl: NavController,
              private googleMaps: GoogleMaps,
              private platform: Platform) {

      console.log("PLATFORM READY!");


  loadMap() {
    // make sure to create following structure in your view.html file
    // and add a height (for example 100%) to it, else the map won't be visible
    // <ion-content>
    //  <div #map id="map" style="height:100%;"></div>
    // </ion-content>

    // create a new map by passing HTMLElement
    let element: HTMLElement = document.getElementById('map');

    let map: GoogleMap = this.googleMaps.create(element);

    // listen to MAP_READY event
    // You must wait for this event to fire before adding something to the map or modifying it in anyway
    map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
      console.log('Map is ready!');

      // create LatLng object
      let ionic: LatLng = new LatLng(43.0741904, -89.3809802);

      // create CameraPosition
      let position: CameraPosition = {
        target: ionic,
        zoom: 18,
        tilt: 30

      // move the map's camera to position

      // create new marker
      let markerOptions: MarkerOptions = {
        position: ionic,
        title: 'Ionic'

        .then((marker: Marker) => {




      Ionic Blank

  <div id="map"></div>

I Got a White Screen


And if i go to Safari Inspector and uncheck any CSS Propertys the map shows!

Unchecked any property and the map shows!

1 Like

Try using the code from your project
But it doesn’t run, I just get a big white screen.

Did you install the plugin correctly with a valid API key?

Yes, I used the same installation I allready have that is working like in here Google Maps Native not Working

And copy your page and component code
And set the app component to use your page as root.
And I only get this.

And Import the page and Component on App Module


  declarations: [
  imports: [
  bootstrap: [IonicApp],
  entryComponents: [
  providers: [
    {provide: ErrorHandler, useClass: IonicErrorHandler}


import { Component } from '@angular/core';

  selector: 'page-google-maps',
  templateUrl: 'google-maps.html'
export class GoogleMapsPage {

  onMapClick(e) {
    console.log('map was clicked', e);

  onMapReady(e) {
    console.log('map is ready', e);




  <ion-navbar color="primary">
    <ion-title>Google Maps</ion-title>



  <google-map (mapClick)="onMapClick($event)" (mapReady)="onMapReady(e)"></google-map>



  selector: 'google-map',
  template: ''
export class GoogleMapComponent implements OnInit {

  private mapContainer: HTMLElement;

  map: GoogleMap;

  private isInit: boolean = false;

  _height: string = '100%';
  set height(val: string) {
    this._height = val;
    this.isInit && this.setHeight();

  get height(): string {
    return this._height;

  _width: string = '100%';
  set width(val: string) {
    this._width = val;
    this.isInit && this.setWidth();

  get width() {
    return this._width;

  mapClick: EventEmitter<any> = new EventEmitter<any>();

  mapReady: EventEmitter<GoogleMap> = new EventEmitter<GoogleMap>();

    private platform: Platform,
    private renderer: Renderer,
    private el: ElementRef,
    private googleMaps: GoogleMaps
  ) {
    this.mapContainer = el.nativeElement;

  ngOnInit() {


      .then(() => { = this.googleMaps.create(this.mapContainer);
          .then(() => {
            this.isInit = true;
          .subscribe(data => this.mapClick.emit(data));



  ngOnDestroy() {;

  private setupContainer() {

    // set display block
    this.renderer.setElementStyle(this.mapContainer, 'z-index', '1000');
    this.renderer.setElementStyle(this.mapContainer, 'display', 'block');

  private setWidth() {
    this.renderer.setElementStyle(this.mapContainer, 'width', this._width);

  private setHeight() {
    this.renderer.setElementStyle(this.mapContainer, 'height', this._height);


I Just upload the code here

So it’s easer to check.
Still not able to run ionic native google maps on iOS.

Can’t see what’s wrong with it.

Instead of setting that page as your root page, try pushing it through HomePage's NavController.

It is possible that the map is initializing before the view is ready (since I have ngOnInit instead of ngAfterViewInit).


I did what you ask me.
And now it works! and is just exactly what I Need.
thanks for the support!

Is this implemented in your repository as I would like to try this out, I’m also having issues getting this working.


I have problems loading the map, I do not know if it will be the same. But when loading. It does so in the following way:


I need help :frowning:


Thanks, thanks :smiley:

I have the same problem, help me!

Hello, I solved the problem by creating an api key for android and not for web, I hope I have helped

Hi @matheusjoveliano,

Yes, the problem is resolved

Thank you :slight_smile:

what process u did ?

If you are still struggling with an blank google map on iOS devices and emulators. Go into your config.xml file.
And between the iOS platform tag

 <platform name="ios"> 

Add this:

<!-- Allow images, xhrs, etc. to -->
<access origin="" />
<access origin="" />

<!-- Access to the subdomain -->
<access origin="" />

<!-- Access to all the subdomains on -->
<access origin="http://*" />

<!-- Enable requests to content: URLs -->
<access origin="content:///*" />

<!-- Don't block any requests -->
<access origin="*" />

Its from the Cordova whitelist plugin documentation

It enables your application to retrieve information from Google Maps domains using the Google Maps JavaScript SDK or otherwise. This had me stumped for a good awhile and hopefully this ends the frustrations for some.