private async void MyMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.UI.Controls.GeoViewInputEventArgs e) { // Clear any existing result. ResultWebView.Visibility = Visibility.Collapsed; // Perform the identify operation. IdentifyLayerResult myIdentifyResult = await MyMapView.IdentifyLayerAsync(_wmsLayer, e.Position, 20, false); // Return if there's nothing to show. if (!myIdentifyResult.GeoElements.Any()) { return; } // Retrieve the identified feature, which is always a WmsFeature for WMS layers. WmsFeature identifiedFeature = (WmsFeature)myIdentifyResult.GeoElements[0]; // Retrieve the WmsFeature's HTML content. string htmlContent = identifiedFeature.Attributes["HTML"].ToString(); // Note that the service returns a boilerplate HTML result if there is no feature found. // This test should work for most arcGIS-based WMS services, but results may vary. if (!htmlContent.Contains("OBJECTID")) { // Return without showing the callout. return; } // Show the result. ResultWebView.NavigateToString(htmlContent); ResultWebView.Visibility = Visibility.Visible; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var item = await SampleDataSource.GetItemAsync((String)e.NavigationParameter); //this.DefaultViewModel["Item"] = item; ResultWebView.NavigateToString(await RssHelper.GetFeedTitleAsync()); }