Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created July 14, 2017 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/a3738f70be699ea0868c1503da5e3227 to your computer and use it in GitHub Desktop.
Save matthieu-D/a3738f70be699ea0868c1503da5e3227 to your computer and use it in GitHub Desktop.
import { Geolocation } from '@ionic-native/geolocation';
export class GeolocationMock extends Geolocation {
latitude = 1;
longitude = 1;
getCurrentPosition() {
return new Promise((resolve, reject) => {
resolve({
coords: {
latitude: this.latitude,
longitude: this.longitude
}
});
})
}
setLatitude(latitude) {
this.latitude = latitude
console.log('Latitude changed to: ', latitude);
}
setLongitude(longitude) {
this.longitude = longitude;
console.log('Longitude changed to: ', longitude);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment