private void _map_LoadStatusChanged(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { if (sender is Map map && e.Status == Esri.ArcGISRuntime.LoadStatus.Loaded) { Dispatcher.BeginInvoke((Action)(() => LegacyMapLoader.InitializeLegacy(LegacyMap, map))); } }
private async void OnLoadedPopulateData(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { // If layer isn't loaded, do nothing if (e.Status != Esri.ArcGISRuntime.LoadStatus.Loaded) { return; } // Create new query object that contains parameters to query specific request types QueryParameters queryParameters = new QueryParameters() { WhereClause = "req_Type = 'Tree Maintenance or Damage'" }; // Create list of the fields that are returned from the service string[] outputFields = { "*" }; try { // Populate feature table with the data based on query await _incidentsFeatureTable.PopulateFromServiceAsync(queryParameters, true, outputFields); } catch (Exception ex) { await Application.Current.MainPage.DisplayAlert("Error", ex.ToString(), "OK"); } }
// Handle the load status changed event for the public and token-secured layers. private void LayerLoadStatusChanged(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { // Get the layer that triggered the event. var layer = sender as Layer; // Get the label for this layer. UILabel labelToUpdate = null; if (layer.Name == _publicLayerName) { labelToUpdate = _publicLayerLabel; } else { labelToUpdate = _secureLayerLabel; } // Create the text string and font color to describe the current load status. var updateText = layer.Name; var textColor = UIColor.Gray; switch (e.Status) { case Esri.ArcGISRuntime.LoadStatus.FailedToLoad: updateText = layer.Name + " (Load failed)"; textColor = UIColor.Red; break; case Esri.ArcGISRuntime.LoadStatus.Loaded: updateText = layer.Name + " (Loaded)"; textColor = UIColor.Green; break; case Esri.ArcGISRuntime.LoadStatus.Loading: updateText = layer.Name + " (Loading ...)"; textColor = UIColor.Gray; break; case Esri.ArcGISRuntime.LoadStatus.NotLoaded: updateText = layer.Name + " (Not loaded)"; textColor = UIColor.LightGray; break; } // Update the layer label on the UI thread. this.BeginInvokeOnMainThread(() => { labelToUpdate.Text = updateText; labelToUpdate.TextColor = textColor; }); }
// Handle the load status changed event for the public and token-secured layers. private void LayerLoadStatusChanged(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { // Get the layer that triggered the event. Layer layer = (Layer)sender; // Get the label (TextView) for this layer. TextView labelToUpdate = null; if (layer.Name == _publicLayerName) { labelToUpdate = _publicLayerLabel; } else { labelToUpdate = _secureLayerLabel; } // Create the text string and font color to describe the current load status. string updateText = layer.Name; Color textColor = Color.Gray; switch (e.Status) { case Esri.ArcGISRuntime.LoadStatus.FailedToLoad: updateText = layer.Name + " (Load failed)"; textColor = Color.Red; break; case Esri.ArcGISRuntime.LoadStatus.Loaded: updateText = layer.Name + " (Loaded)"; textColor = Color.Green; break; case Esri.ArcGISRuntime.LoadStatus.Loading: updateText = layer.Name + " (Loading ...)"; textColor = Color.Gray; break; case Esri.ArcGISRuntime.LoadStatus.NotLoaded: updateText = layer.Name + " (Not loaded)"; textColor = Color.LightGray; break; } // Update the layer label on the UI thread. RunOnUiThread(() => { labelToUpdate.Text = updateText; labelToUpdate.SetTextColor(textColor); }); }
// Handle the load status changed event for the public and token-secured layers. private void LayerLoadStatusChanged(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { // Get the layer that triggered the event. Layer layer = (Layer)sender; // Get the label for this layer. UILabel labelToUpdate = null; if (layer.Name == _publicLayerName) { labelToUpdate = _publicLayerLabel; } else { labelToUpdate = _secureLayerLabel; } // Create the text string and font color to describe the current load status. string updateText = layer.Name; UIColor statusColor = UIColor.Gray; switch (e.Status) { case Esri.ArcGISRuntime.LoadStatus.FailedToLoad: updateText = layer.Name + " (Load failed)"; statusColor = UIColor.FromRGB(0xde, 0x29, 0x00); // red break; case Esri.ArcGISRuntime.LoadStatus.Loaded: updateText = layer.Name + " (Loaded)"; statusColor = UIColor.FromRGB(0x35, 0xac, 0x46); break; case Esri.ArcGISRuntime.LoadStatus.Loading: updateText = layer.Name + " (Loading ...)"; statusColor = UIColor.Gray; break; case Esri.ArcGISRuntime.LoadStatus.NotLoaded: updateText = layer.Name + " (Not loaded)"; statusColor = UIColor.LightGray; break; } // Update the layer label on the UI thread. this.BeginInvokeOnMainThread(() => { labelToUpdate.Text = updateText; labelToUpdate.BackgroundColor = statusColor; }); }
private void WebMapLoadStatusChanged(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { // Get the current status var status = e.Status; // Report errors if map failed to load if (status == Esri.ArcGISRuntime.LoadStatus.FailedToLoad) { var map = sender as Map; var err = map.LoadError; if (err != null) { MessageBox.Show(err.Message, "Map Load Error"); } } }
private void WebMapLoadStatusChanged(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { // Get the current status. var status = e.Status; // Report errors if map failed to load. if (status == Esri.ArcGISRuntime.LoadStatus.FailedToLoad) { var map = sender as Map; var err = map.LoadError; if (err != null) { var alert = new UIAlertView("Map Load Error", err.Message, (IUIAlertViewDelegate)null, "OK", null); alert.Show(); } } }
private void WebMapLoadStatusChanged(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { // Get the current status var status = e.Status; // Report errors if map failed to load if (status == Esri.ArcGISRuntime.LoadStatus.FailedToLoad) { var map = sender as Map; var err = map.LoadError; if (err != null) { var alertBuilder = new AlertDialog.Builder(this); alertBuilder.SetTitle("Map Load Error"); alertBuilder.SetMessage(err.Message); alertBuilder.Show(); } } }
private async void OnLoadedPopulateData(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { // If layer isn't loaded, do nothing if (e.Status != Esri.ArcGISRuntime.LoadStatus.Loaded) { return; } // Create new query object that contains parameters to query specific request types QueryParameters queryParameters = new QueryParameters() { WhereClause = "req_Type = 'Tree Maintenance or Damage'" }; // Create list of the fields that are returned from the service var outputFields = new string[] { "*" }; // Populate feature table with the data based on query await _incidentsFeatureTable.PopulateFromServiceAsync(queryParameters, true, outputFields); }
private async void WebMapLoadStatusChanged(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { // Get the current status var status = e.Status; // Report errors if map failed to load if (status == Esri.ArcGISRuntime.LoadStatus.FailedToLoad) { var map = sender as Map; var err = map.LoadError; if (err != null) { var dialog = new MessageDialog(err.Message, "Map Load Error"); await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() => { await dialog.ShowAsync(); }); } } }
private void Map_LoadStatusChanged(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e) { Trace.WriteLine("Map load status = " + e.Status); }