예제 #1
0
        public void TestMapViewLocationMethods()
        {
            // set up
            var mapView      = new MapView.MapView();
            var locationList = DataServiceHelper.GetDefaultLocationList();

            // run
            mapView.AddLocationList(locationList);

            var location = locationList.First();

            mapView.UpdateLocation(location);
            mapView.ZoomToLocation(location.MapLocation);
            mapView.RemoveLocation(location.Id);

            mapView.ClearLocationList();
        }
예제 #2
0
        /// <summary>
        /// Adds (or replaces) the default location list
        /// </summary>
        /// <returns>task to wait on</returns>
        public static async Task AddDefaultLocationListAsync()
        {
            try
            {
                var locationList = DataServiceHelper.GetDefaultLocationList();

                await ImportLocationListAsync(locationList);
            }
            catch (Exception ex)
            {
                App.LogError(ex);

                await App.Current.MainPage.DisplayAlert(
                    Constants.AppTitle,
                    "Error while loading default locations: " + ex.Message,
                    "OK");
            }
        }