question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: The map does not appear

See original GitHub issue

Bug Report

Capacitor Version

Installed Dependencies:

  @capacitor/core: 3.5.1
  @capacitor/cli: 3.5.1
  @capacitor/android: 3.5.1
  @capacitor/ios: 3.5.1

Platform(s)

  • IOS
  • Android

Current Behavior

Hello,

I have installed a fresh version of ionic (blank) and the plugin @capacitor/google-maps. Then, I have followed the instructions here to configure the tool. Finally, when I launch the simulator to test, nothing appears. No error but no map…

Thanks for your help, Loïc

Expected Behavior

The map should appears

Code Reproduction

HTML

<ion-content [fullscreen]="true">
  <div id="container">
    <capacitor-google-maps #mapRef></capacitor-google-maps>
  </div>
</ion-content>

TypeScript code

import { Component, ElementRef, ViewChild } from '@angular/core';
import { GoogleMap } from '@capacitor/google-maps';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {

  map: GoogleMap;
  mapRefEl = null;
  
  @ViewChild('mapRef')
    set mapRef(ref: ElementRef<HTMLElement>) {
    this.mapRefEl = ref.nativeElement;
  }
  
  constructor() {}
  
  ngAfterViewInit() {
    this.createMap(this.mapRefEl);
  }
  
  async createMap(ref: HTMLElement) {
    this.map = await GoogleMap.create({
      id: 'map-test',
      element: ref,
      apiKey: 'MY-API-KEY',
      config: {
        center: {
          lat: 33.6,
          lng: -117.9
        },
        zoom: 8,
      },
      forceCreate: true,
    });
  }

}

Other Technical Details

npm --version output: 6.14.8 node --version output: v14.15.0 pod --version output (iOS issues only): 1.8.4

###Related topic in the forum

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jcesarmobilecommented, Oct 11, 2022

On iOS it’s not working because of a typo on the docs, it’s capacitor-google-map not capacitor-google-maps.

I have fixed it here https://github.com/ionic-team/capacitor-plugins/pull/1221

On Android and web that doesn’t matter, it still works with the typo. For those that it doesn’t work on Android, the usual problems are missing the API key in the manifest (inside the application tag) or the WebView not being transparent.

1reaction
BrandonBatt3commented, Jul 7, 2022

Hi @loicparent, did you figure out what was going on? We are going through the same issue…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Google Maps Not Showing Map - Technipages
If Google Maps fails to load the map and the streets are not showing, this guide will show you how to fix the...
Read more >
Google Maps not showing route: Learn how to solve this issue ...
The compass not being calibrated can lead to Google Maps not showing map. This can be done easily through simple steps. The user...
Read more >
Bug report: Published edits not showing up - Google Help
Your edit has now been published and I am seeing the changes on the map. Sometimes the map does take a few days...
Read more >
BUG-000091825: The World Topographic Map does not show ...
Bug BUG-000091825 · Synopsis. The World Topographic Map does not show tiles properly at location 6.55, 60 (HORDALAND, Norway area). · Additional Information....
Read more >
[MCPE-76166] Maps and locator maps not appearing - Jira
Bug - A problem which impairs or prevents the functions of the product. MCPE-78097 Map will not appear in my hand. Resolved.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found