Esempio n. 1
0
        private void _onLocation(MvxGeoLocation location)
        {
            _isAvailable = true;

            if (LocationHelper.IsLocationTimestampRecent(location.Timestamp.LocalDateTime) == false)
            {
                return;
            }

            if (LocationHelper.FilterForAccuracy(location.Coordinates.Accuracy.Value, 10) == false)
            {
                return;
            }

            _currentLocation = location;

            var message = new LocationMessage(this,
                                              location.Coordinates.Longitude,
                                              location.Coordinates.Latitude,
                                              location.Coordinates.Speed,
                                              location.Coordinates.Heading,
                                              location.Coordinates.HeadingAccuracy,
                                              location.Timestamp.LocalDateTime);

            _messenger.Publish(message);
        }