Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Ionic geolocation

$
0
0

@BennyTaccardi wrote:

Hi to all, I’m trying to geolocate user in yours current position with ionic-native/geolocation plugin.
My snippet of code is:

this.geolocation.getCurrentPosition().then(res => {
      this.myLat = res.coords.latitude;
      this.myLon= res.coords.longitude;
      this.reverseGeocoding(this.myLat,this.myLon);
      console.log(this.start);
      this.map = new google.maps.Map(this.mapElement.nativeElement, {
        zoom: 7,
        center: {lat: this.myLat, lng: this.myLon}
      });

      this.directionsDisplay.setMap(this.map);
      this.addMarker(this.map);
    }).catch((error) => {
      console.log('Error getting location', error);
    });

On browser it works but on android devices not. What is the trouble? Thanks in advance

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>