public LayerCreationParams( CIMDataConnection dataConnection )
Public Function New( _ ByVal dataConnection As CIMDataConnection _ )
Parameters
- dataConnection
- A ArcGIS.Core.CIM.CIMDataConnection object.
public LayerCreationParams( CIMDataConnection dataConnection )
Public Function New( _ ByVal dataConnection As CIMDataConnection _ )
// Create a connection to the WMS server var serverConnection = new CIMInternetServerConnection { URL = "URL of the WMS service" }; var connection = new CIMWMSServiceConnection { ServerConnection = serverConnection }; // Add a new layer to the map var layerParams = new LayerCreationParams(connection); await QueuedTask.Run(() => { var layer = LayerFactory.Instance.CreateLayer<FeatureLayer>(layerParams, MapView.Active.Map); });
CIMStandardDataConnection cIMStandardDataConnection = new CIMStandardDataConnection() { WorkspaceConnectionString = @"SWAPXY=TRUE;SWAPXYFILTER=FALSE;URL=http://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WFSServer;VERSION=2.0.0", WorkspaceFactory = WorkspaceFactory.WFS, Dataset = "Continent", DatasetType = esriDatasetType.esriDTFeatureClass }; // Add a new layer to the map var layerPamsDC = new LayerCreationParams(cIMStandardDataConnection); await QueuedTask.Run(() => { Layer layer = LayerFactory.Instance.CreateLayer<FeatureLayer>(layerPamsDC, MapView.Active.Map); });
await QueuedTask.Run(() => { Map map = MapView.Active.Map; Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri(@"C:\Connections\mySDE.sde"))); CIMSqlQueryDataConnection sqldc = new CIMSqlQueryDataConnection() { WorkspaceConnectionString = geodatabase.GetConnectionString(), GeometryType = esriGeometryType.esriGeometryPolygon, OIDFields = "OBJECTID", Srid = "102008", SqlQuery = "select * from MySDE.dbo.STATES", Dataset = "States" }; var lcp = new LayerCreationParams(sqldc) { Name = "States" }; FeatureLayer flyr = LayerFactory.Instance.CreateLayer<FeatureLayer>(lcp, map); });
Target Platforms: Windows 11, Windows 10