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

Geolocation Issues

$
0
0

@evripides wrote:

I am trying to use Geolocation but I get the below error
TypeError: Object(…) is not a function
at Geolocation.getCurrentPosition

Ionic Version 3.20.0
cordova-plugin-geolocation 4.0.1 “Geolocation”

my code

import { Geolocation } from ‘@ionic-native/geolocation/ngx’;
mylocation(){
this.geolocation.getCurrentPosition().then((resp) => {
this.lat = resp.coords.latitude;
this.longt =resp.coords.longitude;
}).catch((error) => {
console.log(‘Error getting location’, error);
});
}

any idea what I can do

Thank you

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71530

Trending Articles