I want to be able to create a button that opens up two panes split as shown in the image below.
Currently, I use the following:
protected override async void OnClick()
{
Map map = null;
Map schema = null;
var mapProjectItems = Project.Current.GetItems<MapProjectItem>();
await QueuedTask.Run(() =>
{
if (mapProjectItems.Count() > 0)
{
var mapProjectItem = mapProjectItems.First();
var schemaProjectItem = mapProjectItems.Last();
map = mapProjectItem.GetMap();
ProApp.Panes.CreateMapPaneAsync(map);
schema = schemaProjectItem.GetMap();
ProApp.Panes.CreateMapPaneAsync(schema);
}
else
{
map = MapFactory.Instance.CreateMap("Local Map", MapType.Map, MapViewingMode.Map, Basemap.Terrain);
schema = MapFactory.Instance.CreateMap("Schema", MapType.Map, MapViewingMode.Map, Basemap.None);
}
});
}
But this opens two maps in two different views. How would I make it so it creates the two maps split horizontally or vertically as shown in the image?
Solved! Go to Solution.
Yes, I see your confusion - presumably this sentence? "You can open many panes at the same time, and they can be grouped, tiled (horizontally or vertically), or floated."....
We will change it to "You can open many panes at the same time, and they can be grouped, tiled (horizontally or vertically), or floated - but only interactively" for the next release.
there are a number of different ways to can open panes - map panes in your case -
var mapItem = Project.Current.GetItems<MapProjectItem>().First();
//ok to call on the UI
mapItem.OpenMapPaneAsync(MapViewingMode.Map);
QueuedTask.Run(()=> {
//GetMap needs the QTR but OpenViewAsync does not
mapItem.GetMap().OpenViewAsync();
//assuming u have a map - ok to call on the UI
FrameworkApplication.Panes.CreateMapPaneAsync(map);
However u cannot control their placement. However, if you open a view for a map that was previously opened (in the project in the session) then the pane will go back to the configuration it was last in
It does seem it's possible to control placement, as described here in the #pane section . Although it is not described how exactly.
Hi,
You could use code below to get all MapPanes:
IEnumerable<IMapPane> mapPanes = FrameworkApplication.Panes.OfType<IMapPane>();
foreach (var mapPane in mapPanes)
{
}
It seems to be possible as described here : https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#pane although it is not explained how to do this exactly.
Yes, I see your confusion - presumably this sentence? "You can open many panes at the same time, and they can be grouped, tiled (horizontally or vertically), or floated."....
We will change it to "You can open many panes at the same time, and they can be grouped, tiled (horizontally or vertically), or floated - but only interactively" for the next release.
Yes that's my confusion, the "can be grouped" part made me think it was possible to do it automatically. Too bad it's not possible then!