Hi all,
I have a small problem - in my app I have implemented google maps. Everything work until I redirect to page with map automatically after some http action on other page. Map isn`t rendered but console log is wrote.
My code is:
loadMap() {
GoogleMap.isAvailable().then(() => {
this.map = new GoogleMap(document.getElementById('map'));
// listen to MAP_READY event
this.map.one(GoogleMapsEvent.MAP_READY).then(
() => {
console.log('Map is ready!');
// create LatLng object
let coord: GoogleMapsLatLng = new GoogleMapsLatLng(this.shift.address.latitude, this.shift.address.longitude);
// move the map's camera to position
this.map.moveCamera({
target: coord,
zoom: 16,
tilt: 0
});
// create new marker
let markerOptions: GoogleMapsMarkerOptions = {
position: coord,
};
this.map.addMarker(markerOptions)
.then((marker: GoogleMapsMarker) => {
marker.showInfoWindow();
});
}
);
});
}
In constructor:
this.platform.ready().then(() => {
this.loadMap();
});
Does anybody know how to fix this?
Thanks