public FeatureLayerCreationParams( CIMDataConnection dataConnection )
Public Function New( _ ByVal dataConnection As CIMDataConnection _ )
Parameters
- dataConnection
- A ArcGIS.Core.CIM.CIMDataConnection object.
public FeatureLayerCreationParams( CIMDataConnection dataConnection )
Public Function New( _ ByVal dataConnection As CIMDataConnection _ )
//Note: Call within QueuedTask.Run() if (MapView.Active.Map == null) return; //Get an existing Layer. This layer has a symbol you want to use in a new layer. var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>() .Where(l => l.ShapeType == esriGeometryType.esriGeometryPoint).FirstOrDefault(); //This is the renderer to use in the new Layer var renderer = lyr.GetRenderer() as CIMSimpleRenderer; //Set the DataConnection for the new layer Geodatabase geodatabase = new Geodatabase( new FileGeodatabaseConnectionPath(new Uri(@"E:\Data\Admin\AdminData.gdb"))); FeatureClass featureClass = geodatabase.OpenDataset<FeatureClass>("Cities"); var dataConnection = featureClass.GetDataConnection(); //Create the definition for the new feature layer var featureLayerParams = new FeatureLayerCreationParams(dataConnection) { RendererDefinition = new SimpleRendererDefinition(renderer.Symbol), IsVisible = true, }; //create the new layer LayerFactory.Instance.CreateLayer<FeatureLayer>( featureLayerParams, MapView.Active.Map);
Target Platforms: Windows 11, Windows 10