You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I'm trying to use the example code
$geolocation.watchPosition({
timeout: 6000,
maximumAge: 250,
enableHighAccuracy: true
});
$scope.myPosition = $geolocation.position;
console.log($scope.myPosition.coords);
But the $scope.myPosition have not the coords property.
Any idea?
Regards
The text was updated successfully, but these errors were encountered:
I found that I had to call $geolocation.getCurrentPosition(), even if I don't store use result, before the object position would be initialized. That seems to be a bug.
It's not a "bug", per se. watchPosition() being an asynchronous operation, you can't access the $geolocation.position object right after calling the method (because it's result hasn't been returned yet).
It would have been nice to have some sort of callback or event fired when watchPosition() first get the position, though...
EDIT : My bad... it's the case. See #3.
Hi
I'm trying to use the example code
$geolocation.watchPosition({
timeout: 6000,
maximumAge: 250,
enableHighAccuracy: true
});
$scope.myPosition = $geolocation.position;
console.log($scope.myPosition.coords);
But the $scope.myPosition have not the coords property.
Any idea?
Regards
The text was updated successfully, but these errors were encountered: