示例#1
0
        /// <summary>
        /// 地图图层(控件图层)加载完成,每个图层都会触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MapView_LayerLoaded(object sender, Esri.ArcGISRuntime.Controls.LayerLoadedEventArgs e)
        {
            var layer = e.Layer as ArcGISTiledMapServiceLayer;

            if (layer != null)
            {
                if (_tiledInfo != null)
                {
                    return;
                }
                _tiledInfo = layer.TileInfo;
            }
            var eLayer = e.Layer as ArcGISDynamicMapServiceLayer;

            if (eLayer == null)
            {
                return;
            }
            foreach (LayerObject lo in ConfigUtil.DynamicLayer)
            {
                if (lo.Id == eLayer.ID)
                {
                    lo.ServiceInfo = eLayer.ServiceInfo;
                }
            }
        }
        private void MySceneView_LayerLoaded(object sender, Esri.ArcGISRuntime.Controls.LayerLoadedEventArgs e)
        {
            //Add kml layer to the treeView
            if (e.Layer is KmlLayer)
            {
                ObservableCollection <KmlFeature> kmlFeatureList = new ObservableCollection <KmlFeature>();
                kmlFeatureList.Add((e.Layer as KmlLayer).RootFeature);

                treeView.ItemsSource = kmlFeatureList;
            }
        }
示例#3
0
 private void MyMapView_LayerLoaded(object sender, Esri.ArcGISRuntime.Controls.LayerLoadedEventArgs e)
 {
     if (e.Layer.ID == "ImageLayer")
     {
         ArcGISImageServiceLayer imageLayer = e.Layer as ArcGISImageServiceLayer;
         if (e.LoadError == null)
         {
             RasterFunctionsComboBox.ItemsSource   = imageLayer.ServiceInfo.RasterFunctionInfos;
             RasterFunctionsComboBox.SelectedIndex = 0;
         }
     }
 }
示例#4
0
        private async void mapView1_LayerLoaded(object sender, Esri.ArcGISRuntime.Controls.LayerLoadedEventArgs e)
        {
            if (e.Layer.ID == "ParcelsGraphicsLayer")
            {
                if (parcelGraphicsLayer != null && parcelGraphicsLayer.Graphics.Count == 0)
                {
                    QueryTask queryTask = new QueryTask(new Uri("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/TaxParcel/AssessorsParcelCharacteristics/MapServer/1"));

                    //Create a geometry to use as the extent within which parcels will be returned
                    var contractRatio  = mapView1.Extent.Width / 6;
                    var extentGeometry = new Envelope(-83.3188395774275, 42.61428312652851, -83.31295664068958, 42.61670913269855);

                    extentGeometry.SpatialReference = SpatialReferences.Wgs84;
                    Query query = new Query(extentGeometry);
                    query.ReturnGeometry      = true;
                    query.OutSpatialReference = mapView1.SpatialReference;

                    try
                    {
                        var results = await queryTask.ExecuteAsync(query, CancellationToken.None);

                        foreach (Graphic g in results.FeatureSet.Features)
                        {
                            g.Geometry.SpatialReference = mapView1.SpatialReference;
                            parcelGraphicsLayer.Graphics.Add(g);
                        }
                        LoadingParcelsIndicator.IsActive   = false;
                        LoadingParcelsContainer.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                        ControlsContainer.Visibility       = Visibility.Visible;
                    }
                    catch (Exception ex)
                    {
                        var dlg = new Windows.UI.Popups.MessageDialog(ex.Message);
                        var _   = dlg.ShowAsync();
                    }
                }
                await SelectParcelForOffset();
            }
        }