Answers for "open longitude and latitude in ionic"

0

open longitude and latitude in ionic

import { Geolocation } from '@ionic-native/geolocation/ngx';

...

constructor(private geolocation: Geolocation) {}

...

this.geolocation.getCurrentPosition().then((resp) => {
 // resp.coords.latitude
 // resp.coords.longitude
}).catch((error) => {
  console.log('Error getting location', error);
});

let watch = this.geolocation.watchPosition();
watch.subscribe((data) => {
 // data can be a set of coordinates, or an error (if an error occurred).
 // data.coords.latitude
 // data.coords.longitude
});
Posted by: Guest on January-14-2021

Code answers related to "open longitude and latitude in ionic"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language