Я создал ионное приложение (для iOS и Android), используя Google Map и маркеры. Моя цель - отобразить автономную карту с маркером в приложении. Я написал код, который прекрасно работает для приложения iOS, но проблема в том, что маркер не отображается на карте для приложения Android. Пожалуйста, помогите мне с этим. Мой код ниже:
let mapOptions: GoogleMapOptions = {
mapType: "MAP_TYPE_ROADMAP",
controls: {
compass: false,
myLocationButton: false,
myLocation: false,
indoorPicker: false,
mapToolbar: false,
zoom: false
},
camera: {
target: point,
zoom: zoom,
tilt: 0
},
gestures: {
rotate: false,
tilt: false,
scroll: false,
zoom: false
}
};
let element: HTMLElement = document.getElementById(id);
// Create a map after the view is ready and the native platform is ready.
this.map = GoogleMaps.create(element, mapOptions);
// Wait the maps plugin is ready until the MAP_READY event
this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
this.map.addMarker({
title: 'Ionic',
icon: 'red',
animation: 'DROP',
position: point
})
.then(marker => {
marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
});
});
let cameraPos: CameraPosition<ILatLng> = {
target: point
};
this.map.moveCamera(cameraPos);
});