Parameters
- map
- Camera
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
{
var project = Project.Current;
await QueuedTask.Run(() =>
{
//Change the map associated with a map frame
//Find a map frame element from a layout by the map frame's element name
MapFrame mfrm = layout.FindElement("Map Frame") as MapFrame;
//Reference map from the project item
Map myMap = project.GetItems<MapProjectItem>().FirstOrDefault(m => m.Name.Equals("Map1")).GetMap();
//Set the map to the map frame
mfrm.SetMap(map);
});
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)