geolocation + ionic native Not working with few android devices
Asked Answered
D

0

6

please help me out from this issue,

geolocation plugin not working with some android devices. it tested on different Android phones to identify current location on map issues, find below results:

============ I have tested these couple of devices ==========

Coolpad 3600I | Android 6.0.1 | Not working

Redmi note 4 | Android 7, MIUI 9 | Not working

Moto g 3 | Android 6 | Not working

Redmi note 4 | Android 7, MIUI 9 | Not working

Redmi 4 | Android 7.1.2, MIUI 9.1 | working

Moto G4 Plus | Android 7.0 | working

MI Note 3 | Android 6+, MIUI 8+ | working

Honor holly 2 plus | | working

Samsung J7 | | working

Moto g 3 | | working


GetLatLong(){
      this.platform.ready().then(() => {
        var myoption = {
            timeout:5000,
            enableHighAccuracy:true
          }

        this.geolocation.getCurrentPosition(myoption).then(resp => {
          this.lattitude = resp.coords.latitude;
          this.longitude = resp.coords.longitude;
          this.location = "SUCCESS";
         })

        let latLng = new google.maps.LatLng(this.lattitude, this.longitude);
        let mapOptions = {
           center: latLng,
           zoom: 14,
           mapTypeId: google.maps.MapTypeId.ROADMAP 
          }
        this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
          this.marker = new google.maps.Marker({
            map: this.map,
            zoom: 14,
            animation: google.maps.Animation.DROP,
            position: latLng,
          });
      })
  }

all detail describe in this link.

for more detail refer this link

Dorset answered 30/11, 2017 at 5:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.