Hi, I’m trying to use the GeoLocation but it fails on iOS. I can’t test on Android at the moment.
I’m on version 0.10.0, build 6044.
Here is my JS code :
var geolocate = function() {
GeoLocation.getLocation(5000).then(function(location) {
geoloc.value = location.latitude + ', ' + location.longitude;
});
}
And here is what XCode tells me :
libc++abi.dylib: terminating with uncaught exception of type uThrowable: Uno.Exception
Any idea ?
Thanks
NB : GeoLocation.startListening + GeoLocation.onChanged works well.
EDIT : Complete test case :
<App Theme="Basic" Background="#eeeeeeff">
<JavaScript File="MainView.js"/>
<StatusBarBackground />
<Rectangle Height="50" CornerRadius="10" Margin="0,10" Fill="#BD192E" Clicked="{geolocate}">
<Text Value="Geolocate me" Alignment="Center" TextColor="White" />
</Rectangle>
<Text Value="{geoloc}" Alignment="Center" />
</App>
var Observable = require('FuseJS/Observable');
var GeoLocation = require('FuseJS/GeoLocation');
var geoloc = Observable('Unknown location');
var geolocate = function() {
GeoLocation.getLocation(5000).then(function(location) {
geoloc.value = location.latitude + ', ' + location.longitude;
}).catch(function(e) {
console.log(JSON.stringify(e));
});
}
module.exports = {
geoloc: geoloc,
geolocate: geolocate
};