bug: The map does not appear
See original GitHub issueBug 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:
- Created a year ago
- Comments:7 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On iOS it’s not working because of a typo on the docs, it’s
capacitor-google-map
notcapacitor-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.
Hi @loicparent, did you figure out what was going on? We are going through the same issue…