4
initMap(): Promise<any> {
this.mapInitialised = true;//part 1
return new Promise((resolve) => {
this.geolocation.getCurrentPosition().then((position) => {// Part 2
let latLng = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
let mapOptions = {
center: latLng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
this.map = new google.maps.Map(this.mapElement, mapOptions);
resolve(true);
});
});
}
これは、https://stackoverflow.com/questions/41834382/ionic2-geolocation-in-browser-fails-with-error-exception-uncaught-in-promiseの複製である可能性があります。 – CrazyPyro