Hello,
I have created an ArcGIS Pro button using ArcGIS Pro SDK to add a feature class to a map. My code is below. How would I add to this button to now symbolize that polygon feature class to have a black outline and yellow fill?
Here is what I have to add a feature class:
protected override void OnClick()
{
if (MapView.Active?.Map == null) return;
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
using (Geodatabase geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(@"L:\data\ESRI_10_6\usa\census\states.gdb"))))
{
using (FeatureClass addFeatureClass = geodatabase.OpenDataset<FeatureClass>("states"))
{
LayerFactory.Instance.CreateFeatureLayer(addFeatureClass, MapView.Active.Map, 0, "states");
}
}
});
How do I now add to this button code to now symbolize as a black outline and yellow fill? How do I reference the above feature class that I just added to the map? I can't seem to figure out how to do this. Your help would be much appreciated.
Thank you!
Hi Joshua
Here is the code for a Simple renderer that could help: Simple Renderer for a Polygon feature layer.
Using this code snippet above, here is how the polygon feature will get renderered -