Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
var map = MapView.Active.Map; //If clipping is set to ArcGIS.Core.CIM.ClippingMode.None or ArcGIS.Core.CIM.ClippingMode.MapSeries null is returned //If clipping is set to ArcGIS.Core.CIM.ClippingMode.MapExtent the ArcGIS.Core.CIM.CIMMap.CustomFullExtent is returned. //Otherwise, if clipping is set to ArcGIS.Core.CIM.ClippingMode.CustomShape the custom clip polygon is returned. var poly = map.GetClipGeometry(); //You can use the polygon returned //For example: We make a polygon graphic element and add it to a Graphics Layer. var gl = map.GetLayersAsFlattenedList().OfType<GraphicsLayer>().FirstOrDefault(); if (gl == null) return; var polygonSymbol = SymbolFactory.Instance.ConstructPolygonSymbol(CIMColor.CreateRGBColor(255, 255, 0)); var cimGraphicElement = new CIMPolygonGraphic { Polygon = poly, Symbol = polygonSymbol.MakeSymbolReference() }; gl.AddElement(cimGraphicElement);
Target Platforms: Windows 11, Windows 10