Hello, I am with a problem that I can not solve and I do not know if it is an error of mine or a plugin bug.
I’m using https://ionicframework.com/docs/native/google-maps/ the map loads well, I can interact by adding markers, modifying options, etc. But I can not scroll the map with the touch of the mobile, it is as if it will not take any event, if I do pinch to zoom does not do anything either.
I am using Ionic 3.7.0 and the latest version of the plugin.
As an added, I encapsulated the map logic in a component, since I use it for different views, from product.js I open a view (it is called modal-gmap.html, but I do not invoke it as modal because that way the map does not Loaded) and within that view I raise the google-maps component.
product.ts
public openMap(){
this.navCtrl.push(ModalGmapPage, {
multiple: true,
gmapdata:{}
});
}
modal-gmap.html
<ion-content padding>
<google-maps [gmapdata]="gmapdata" [multiple]=multiple [zoom]=zoom></google-maps>
</ion-content>
google-maps.ts
ngAfterViewInit(){
this.loadMap(lat, lng, markertitle, zoom);
}
loadMap(lat:number, lng:number, marker_title:string, zoom:number) {
let element: HTMLElement = document.getElementById('map');
let map: GoogleMap = this.googleMaps.create(element);
map.on(GoogleMapsEvent.MAP_READY).subscribe(
() => {
let my_loc: LatLng = new LatLng(lat, lng);
let position: CameraPosition = {
target: {
lat: my_loc.lat,
lng: my_loc.lng
},
zoom: zoom
};
map.moveCamera(position);
let markerOptions: MarkerOptions = {
position: my_loc,
title: marker_title
};
map.addMarker(markerOptions)
.then((marker: Marker) => {
marker.showInfoWindow();
});
},
(error) => {
}
);
}
google-maps.html
<div #map id="map" style="height: 100%;"></div>
Thank you very much for any help.