What is ArcObjects IMxDocument.CurrentLocation equivalent in Pro SDK?

566
3
04-20-2018 04:11 PM
FayuLai
New Contributor II

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

0 Kudos
3 Replies
by Anonymous User
Not applicable

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...  

0 Kudos
FayuLai
New Contributor II

Thank you very much, Chris!

0 Kudos
Wolf
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

0 Kudos