onEnter() { let targetDiv = document.getElementById("googleMap"); this.$cordovaGeolocation .getCurrentPosition(<ngCordova.IGeolocationOptions>{timeout: 10000, enableHighAccuracy: false}) .then((position) => { console.log("position found"); this.position = position; console.log(position); var latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); var mapOptions = { center: latLng, zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP }; this.maps = new google.maps.Map(targetDiv, mapOptions); console.log('show'); }, (err) => { console.log("unable to find location"); this.errorMsg = "Error : " + err.message; }); }