FeatureLayerCreationParams Constructor(Uri)
Creates a parameter object with
System.Uri.
Create layer with create-params
var flyrCreatnParam = new FeatureLayerCreationParams(new Uri(@"c:\data\world.gdb\cities"))
{
Name = "World Cities",
IsVisible = false,
MinimumScale = 1000000,
MaximumScale = 5000,
// At 2.x - DefinitionFilter = new CIMDefinitionFilter()
//{
// DefinitionExpression = "Population > 100000",
// Name = "More than 100k"
//},
DefinitionQuery = new DefinitionQuery(whereClause: "Population > 100000", name: "More than 100k"),
RendererDefinition = new SimpleRendererDefinition()
{
SymbolTemplate = SymbolFactory.Instance.ConstructPointSymbol(
CIMColor.CreateRGBColor(255, 0, 0), 8, SimpleMarkerStyle.Hexagon).MakeSymbolReference()
}
};
var featureLayer = LayerFactory.Instance.CreateLayer<FeatureLayer>(
flyrCreatnParam, map);
Create FeatureLayer and set to not display in Map.
//The catalog path of the feature layer to add to the map
var featureClassUriVisibility = new Uri(@"C:\Data\Admin\AdminData.gdb\USA\cities");
//Define the Feature Layer's parameters.
var layerParamsVisibility = new FeatureLayerCreationParams(featureClassUriVisibility)
{
//Set visibility
IsVisible = false,
};
//Create the layer with the feature layer parameters and add it to the active map
var createdFC = LayerFactory.Instance.CreateLayer<FeatureLayer>(layerParamsVisibility, MapView.Active.Map);
Create Stream Layer with URI
//Must be on the QueuedTask
var url = "https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer";
var createParam = new FeatureLayerCreationParams(new Uri(url))
{
IsVisible = false //turned off by default
};
var streamLayer = LayerFactory.Instance.CreateLayer<StreamLayer>(createParam, map);
//or use "original" create layer (will be visible by default)
Uri uri = new Uri(url);
streamLayer = LayerFactory.Instance.CreateLayer(uri, map) as StreamLayer;
streamLayer.SetVisibility(false);//turn off
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.