Hi i’m using Google Map plugin on ionic 3 but when the app loaded, the error occur.
here if my code on home.ts
import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
import {
GoogleMaps,
GoogleMap,
GoogleMapOptions,
GoogleMapsEvent,
Marker,
GoogleMapsAnimation,
MyLocation
} from '@ionic-native/google-maps';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
map: GoogleMap;
constructor(public navCtrl: NavController, private platform: Platform) {
this.platform.ready().then(() => {
setTimeout(() => {
this.loadMap();
}, 3000)
});
}
ionViewDidLoad() {
}
loadMap() {
let mapOptions: GoogleMapOptions = {
camera: {
target: {
lat: 43.0741904,
lng: -89.3809802
},
zoom: 18,
tilt: 30
}
};
this.map = GoogleMaps.create('map_canvas', mapOptions);
this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
console.log('Map is ready!');
});
}
onMapReady() {
console.log('map is ready!');
}
}
on home.html
<ion-content>
<div style="height: 100%; background-color:#eee;" #map_canvas id="map_canvas"></div>
</ion-content>
anyone have idea how to fix it?