How to make a map the Active map in MapView

589
2
02-20-2020 11:49 AM
JamalWest2
Occasional Contributor

I am adding a layout to my project. The layout has 3 MapFrames and each MapFrame contains a map. I am trying to figure out how to select a specific map and make it the MapView.Active.Map? I have not found anyway to do this. I want to do this so I can make changes to the extent of the map and zoom to the extent. You can do this in Pro by simply clicking the map and that will make it active. How do I achieve this through the sdk?.

0 Kudos
2 Replies
GKmieliauskas
Esri Regular Contributor

Hi Jamal,

I have my own view pane, but I think way is the same as in code below:

            foreach (var pane in FrameworkApplication.Panes)
            {
                var profilePane = pane as ViewStatePane;
                if (profilePane != null)
                {
                    if (profilePane.ContentID == "ceProfilePro_ProfilePane" && profilePane.Caption == item.Text)
                    {
                        profilePane.Activate();
                        break;
                    }
                }
            }

Change pane checking condition with yours.

0 Kudos
JamalWest2
Occasional Contributor

Thanks for the reply, I figured out a way to do what I needed yesterday finally.

0 Kudos