How to zoom/change a new map created with an ArcGIS Pro Configuration

560
1
02-19-2021 02:05 PM
JoeMadrigal
New Contributor III

In my new startup screen I created when doing an ArcGIS Pro configuration, I created a command tied to one of my buttons that creates a new project using Project.CreateAsync().  If I try doing anything with the map immediately following this, I just have issues because the map takes a while to create and my configuration probably goes out of scope (and closes) or something after issuing that command.  Maybe I need to do this in some kind of Map created event?

What I want to do is have a user select a point of interest in the world and the new map will zoom to that extent.  Say a user selects Nebraska from a list in my startup dialog.  I want to create a new map and zoom to Nebraska and perhaps change to another coordinate system.

Any ideas or thoughts how to accomplish this?

Tags (1)
0 Kudos
1 Reply
JoeMadrigal
New Contributor III

I figured it out.  Before calling Project.Async(), subscribe to the MapViewInitializedEvent Event.  A good example is in the ConfigWithStartWizard in the community examples.  I missed it the first time reviewing this project.

0 Kudos