What is ArcObjects IMxDocument.CurrentLocation equivalent in Pro SDK?

152
3
04-20-2018 04:11 PM
Highlighted
New Contributor II

I am trying to know the mouse location in a map tool using Pro SDK.

Reply
0 Kudos
3 Replies
Highlighted
Esri Regular Contributor

Hi Fayu,

At present, there is not an equivalent to IMxDocument.CurrentLocation. You will need to capture the position within a mouse event such as the following, using the ClientToMap method:
https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-MapExploration#create-a-tool-to-the-return-c...  

Reply
0 Kudos
Highlighted
New Contributor II

Thank you very much, Chris!

Reply
0 Kudos
Highlighted
by Esri Regular Contributor
Esri Regular Contributor

Hi Fayu,

 Just to clarify there is no IMxDocument, but there is the MapView class which might give you what you need.  If you use MapView.Active you will get the current active MapView, or null if there is no Map View open.  Once you have the active MapView you can look at the Camera property to get the location in 2D where the camera defines its viewing location using X and Y.  This will be the center point of the 2D view’s extent.

 Hope this helps.

 Wolf

Reply
0 Kudos