Beispiel #1
0
        private async void LoadService()
        {
            try
            {
                _loadingProgressBar.StartAnimating();
                _loadServiceButton.Enabled  = false;
                _chooseLayersButton.Enabled = false;

                // Create the WFS service.
                WfsService service = new WfsService(new Uri(_loadServiceButton.Title));

                // Load the WFS service.
                await service.LoadAsync();

                // Get the service metadata.
                _serviceInfo = service.ServiceInfo;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                new UIAlertView("Error", ex.Message, (IUIAlertViewDelegate)null, "Error loading service", null).Show();
            }
            finally
            {
                // Update the UI.
                _loadingProgressBar.StopAnimating();
                _loadServiceButton.Enabled  = true;
                _chooseLayersButton.Enabled = true;
            }
        }
        private async void LoadService()
        {
            try
            {
                _loadingProgressBar.Visibility = ViewStates.Visible;
                _loadLayerButton.Enabled       = false;
                _loadServiceButton.Enabled     = false;

                // Create the WFS service.
                WfsService service = new WfsService(new Uri(_loadServiceButton.Text));

                // Load the WFS service.
                await service.LoadAsync();

                // Get the service metadata.
                _serviceInfo = service.ServiceInfo;
            }
            catch (Exception ex)
            {
                new AlertDialog.Builder(this).SetMessage(ex.Message).SetTitle("Error loading service").Show();
            }
            finally
            {
                // Update the UI.
                _loadingProgressBar.Visibility = ViewStates.Gone;
                _loadLayerButton.Enabled       = true;
                _loadServiceButton.Enabled     = true;
            }
        }
        private async void Initialize()
        {
            // Create the map with imagery basemap.
            _myMapView.Map = new Map(Basemap.CreateImagery());

            // Create the WFS service.
            WfsService service = new WfsService(new Uri(ServiceUrl));

            // Load the WFS service.
            await service.LoadAsync();

            // Store information about the WFS service for later.
            _serviceInfo = service.ServiceInfo;

            // Update the UI.
            _chooseLayersButton.Enabled = true;
        }
Beispiel #4
0
        private async void LoadService()
        {
            try
            {
                LoadingProgressBar.Visibility = Visibility.Visible;
                LoadLayersButton.IsEnabled    = false;
                LoadServiceButton.IsEnabled   = false;

                // Create the WFS service.
                WfsService service = new WfsService(new Uri(ServiceTextBox.Text));

                // Load the WFS service.
                await service.LoadAsync();

                // Get the service metadata.
                WfsServiceInfo serviceInfo = service.ServiceInfo;

                // Get a reversed list of available layers.
                IEnumerable <WfsLayerInfo> layerListReversed = serviceInfo.LayerInfos.Reverse();

                // Show the layers in the UI.
                WfsLayerList.ItemsSource = layerListReversed;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                await new MessageDialog(ex.Message, "Error loading service").ShowAsync();
            }
            finally
            {
                // Update the UI.
                LoadingProgressBar.Visibility = Visibility.Collapsed;
                LoadLayersButton.IsEnabled    = true;
                LoadServiceButton.IsEnabled   = true;
            }
        }
Beispiel #5
0
        private async void Initialize()
        {
            // Create the map with imagery basemap.
            MyMapView.Map = new Map(Basemap.CreateImagery());

            // Create the WFS service.
            WfsService service = new WfsService(new Uri(ServiceUrl));

            // Load the WFS service.
            await service.LoadAsync();

            // Get the service metadata.
            WfsServiceInfo serviceInfo = service.ServiceInfo;

            // Get a reversed list of available layers.
            IEnumerable <WfsLayerInfo> layerListReversed = serviceInfo.LayerInfos.Reverse();

            // Show the layers in the UI.
            WfsLayerList.ItemsSource = layerListReversed;

            // Update the UI.
            LoadingProgressBar.IsVisible = false;
            LoadLayersButton.IsEnabled   = true;
        }
Beispiel #6
0
        private async void LoadService()
        {
            try
            {
                LoadingProgressBar.IsVisible = true;
                LoadLayersButton.IsEnabled   = false;
                LoadServiceButton.IsEnabled  = false;

                // Create the WFS service.
                WfsService service = new WfsService(new Uri(ServiceTextBox.Text));

                // Load the WFS service.
                await service.LoadAsync();

                // Get the service metadata.
                WfsServiceInfo serviceInfo = service.ServiceInfo;

                // Get a reversed list of available layers.
                IEnumerable <WfsLayerInfo> layerListReversed = serviceInfo.LayerInfos.Reverse();

                // Show the layers in the UI.
                WfsLayerList.ItemsSource = layerListReversed;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                await Application.Current.MainPage.DisplayAlert(ex.Message, "Error loading service", "OK");
            }
            finally
            {
                // Update the UI.
                LoadingProgressBar.IsVisible = false;
                LoadLayersButton.IsEnabled   = true;
                LoadServiceButton.IsEnabled  = true;
            }
        }