ArcGIS Pro 3.0.3 SDK Missing CreateRasterLayer and CreateFeatureLayer Methods

390
1
Jump to solution
02-09-2023 04:41 PM
RichardDaniels
Occasional Contributor III

In ArcGIS.Desktop.Mapping within the ArcGIS Pro 3.0.3 SDK the following method has been removed:

var x = LayerFactory.Instance.CreateRasterLayer(uri, mapView.Map, 0, theShortName)

var x = LayerFactory.Instance.CreateFeatureLayer(uri, mapView.Map, 0, theShortName)

what are there replacement? 

0 Kudos
1 Solution

Accepted Solutions
RichardDaniels
Occasional Contributor III

Found what I was looking for: ProConcepts 3.0 Migration Guide · Esri/arcgis-pro-sdk Wiki · GitHub

In 2.x this line:

var x = ArcGIS.Desktop.Mapping.LayerFactory.Instance.CreateFeatureLayer(uri, mapView.Map, 0, theShortName)

Is now replaced by:

var layerParams = new FeatureLayerCreationParams(uri)
{
MapMemberPosition = MapMemberPosition.AddToBottom,
Name = theShortName
};
var x = LayerFactory.Instance.CreateLayer<FeatureLayer>(layerParams, mapView.Map);

View solution in original post

1 Reply
RichardDaniels
Occasional Contributor III

Found what I was looking for: ProConcepts 3.0 Migration Guide · Esri/arcgis-pro-sdk Wiki · GitHub

In 2.x this line:

var x = ArcGIS.Desktop.Mapping.LayerFactory.Instance.CreateFeatureLayer(uri, mapView.Map, 0, theShortName)

Is now replaced by:

var layerParams = new FeatureLayerCreationParams(uri)
{
MapMemberPosition = MapMemberPosition.AddToBottom,
Name = theShortName
};
var x = LayerFactory.Instance.CreateLayer<FeatureLayer>(layerParams, mapView.Map);