public async Task TestMethod1()
        {
            GpsTracker tracker = new GpsTracker();
            var        pos     = await tracker.GetCoordinates();

            geoposition = pos.Coordinate.Point.Position;
            var    bboxRightCoord = GeoUtils.DestinationPoint(geoposition, 5000, 45.0);
            var    bboxLeftCoord  = GeoUtils.DestinationPoint(geoposition, 5000, -135.0);
            String uri            = String.Format("{0}{1},{2},{3},{4}", _serviceUrl, bboxLeftCoord.Longitude, bboxLeftCoord.Latitude, bboxRightCoord.Longitude, bboxRightCoord.Latitude);

            Debug.WriteLine(uri);
        }
        private async void RefreshButton_OnClick(object sender, RoutedEventArgs e)
        {
            try {
                ProgressRing.IsActive = true;
                var pos = await _geolocator.GetCoordinates();

                var list = await _searchService.FindCachesNearby(pos.Coordinate.Point.Position, 5000);

                _appState.CachesNearby.Clear();
                foreach (var cache in list)
                {
                    _appState.CachesNearby.Add(cache);
                }
            } catch (Exception ex) {
                Debug.WriteLine("[ERROR] " + ex.Message);
            } finally {
                ProgressRing.IsActive = false;
            }
        }
Example #3
0
        private async void GetInitialGpsPosition()
        {
            Geoposition pos = await _geolocator.GetCoordinates();

            UpdateGpsData(pos.Coordinate);
        }