Ionic 2 map loading "Uncaught (in promise): [object PositionError]"


#1
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);

  });

});
}

#2

Any solutions? Did you solve it?


#3

Just a heads up if you’re trying to run that in a browser, it won’t work.