Я не вижу карту на устройстве Android.
Я создал необходимый API для Android SDK и выполнил действия, указанные в сообщении Stackoverflow:
https://ionic.tutorials24x7.com/blog/implement-google-maps-in-ionic-4-for-android
Но я не заставил его работать, и это не дает мне никакой ошибки.
loadMap () {
this.map = GoogleMaps.create('map_canvas', {
camera: {
target: {
lat: 43.0741704,
lng: -89.3809802
},
zoom: 18,
tilt: 30
}
});
}
async onButtonClick () {
this.map.clear();
this.map.getMyLocation().then((location: MyLocation) => {
console.log(JSON.stringify(location, null ,2));
// Move the map camera to the location with animation
this.map.animateCamera({
target: location.latLng,
zoom: 17,
tilt: 30
});
// add a marker
let marker: Marker = this.map.addMarkerSync({
title: '@ionic-native/google-maps plugin!',
snippet: 'This plugin is awesome!',
position: location.latLng,
animation: GoogleMapsAnimation.BOUNCE
});
// show the infoWindow
marker.showInfoWindow();
// If clicked it, display the alert
marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
this._defaultService.mostrar_toast('clicked!', 2000);
});
})
.catch(err => {
this._defaultService.mostrar_toast(err.error_message, 2000);
});
}
Как запустить браузер ionic cordova run, если вы видите карту, я думаю, что это может быть проблема с API, ноЯ не знаю, что это может быть.