private async void MyMapView_Loaded(object sender, RoutedEventArgs e) { var portal = await ArcGISPortal.CreateAsync(); _currentVM = PortalSearch.GetSelectedItem(); MyMapView.Map = _currentVM.Map; var result = await portal.ArcGISPortalInfo.SearchBasemapGalleryAsync(); basemapList.ItemsSource = result.Results; }
public MapPage() { this.InitializeComponent(); MyMapView.LocationDisplay.LocationProvider = new SystemLocationProvider(); MyMapView.LocationDisplay.LocationProvider.StartAsync(); HardwareButtons.BackPressed += HardwareButtons_BackPressed; MyMapView.Loaded += MyMapView_Loaded; _locatorTask = new OnlineLocatorTask(new Uri(OnlineLocatorUrl)); _locatorTask.AutoNormalize = true; _directionPointSymbol = LayoutRoot.Resources["directionPointSymbol"] as Esri.ArcGISRuntime.Symbology.Symbol; _stopsOverlay = MyMapView.GraphicsOverlays["StopsOverlay"]; _routesOverlay = MyMapView.GraphicsOverlays["RoutesOverlay"]; _directionsOverlay = MyMapView.GraphicsOverlays["DirectionsOverlay"]; _myLocationOverlay = MyMapView.GraphicsOverlays["LocationOverlay"]; _routeTask = new OnlineRouteTask(new Uri(OnlineRoutingService)); _campos = new Dictionary <String, String>(); if (PortalSearch.GetSelectedItem().Map.Layers.Count() > 0) { foreach (Layer i in PortalSearch.GetSelectedItem().Map.Layers) { try { if (!((FeatureLayer)i).FeatureTable.IsReadOnly && ((FeatureLayer)i).FeatureTable.GeometryType == GeometryType.Point) { _layer = i as FeatureLayer; _table = (ArcGISFeatureTable)_layer.FeatureTable; MenuFlyoutAddButton.IsEnabled = true; } } catch { } } } }