Created
July 14, 2017 15:15
-
-
Save matthieu-D/a3738f70be699ea0868c1503da5e3227 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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