0
I developed an Ionic 3 application and implemented the Googlemaps API, when I run the command Ionic Cordova run browser the map works perfectly, but when I will perform the test on Android or Ios the map does not appear, shows only the screen with the Google logo at the bottom corner. I already followed the manual on the Ionic Framework website, but the fault continues to occur. Below is the code of the method that forms the map.
carregarMapa() {
let element: HTMLElement = document.getElementById('map_canvas');
let map: GoogleMap = this.googleMaps.create(element);
Environment.setEnv({
'API_KEY_FOR_BROWSER_RELEASE': CONF_API.apiKeyGoogle,
'API_KEY_FOR_BROWSER_DEBUG': CONF_API.apiKeyGoogle
});
map.one(GoogleMapsEvent.MAP_READY).then(()=>{
console.log('Map is ready!');
let posicao: LatLng = new LatLng(this.posicao.lat, this.posicao.lng);
let posicaoCam: CameraPosition<LatLng> = {
target: posicao,
zoom: 15,
tilt: 30
}
map.moveCamera(posicaoCam);
//inserir um marcador
let marcadorConfig: MarkerOptions = {
position: posicao,
title: 'Cliente'
}
map.addMarker(marcadorConfig).then((marcacao:Marker) =>{
marcacao.showInfoWindow();
});
})
}
On the Googleapis platform the Key is unrestricted, the Apis are active. I need support to make work on Android and iOS.