I want to catch the event when z changes (when I scroll the mouse wheel) in the Stereo Map. In ArcMap, I used the following code in a ToolControl:
((IEditEvents2_Event)_editor).OnCurrentZChanged += OnCurrentZChanged
How can I achieve this in ArcGIS Pro? I tried the following method in a MapTool, but this only reacts when x and/or y change:
protected override async void OnToolMouseMove(MapViewMouseEventArgs e)
Any help is appreciated!
Solved! Go to Solution.
I tried the OnToolMouseMoveEvent in a MapTool again (see above), and now (in ArcGIS Pro 3.4), it catches the event when the z-value of the cursor changes!
the MapViewCameraChangedEvent Class—ArcGIS Pro event provides the before and after status of the camera (PreviousCamera and CurrentCamera) and the Camera object has x, y and z properties (amongst others) so you can quickly test if PreviousCamera.z != CurrentCamera.z (or the opposite) and implement whatever logic you need if the test is successful (the z value has changed).
Hi Selim,
thanks for your reply! I want to display the current object height (height above sea level minus DTM height) in a text box inside a dockpane, when the user moves the mouse (x,y and z) on the stereo map. This could be achieved in ArcObjects using the event OnCurrentZChanged (see above).
Unfortunately, MapViewCameraChangedEvent does not catch the event when the mouse (x,y,z) moves on the map (or stereo map) , it only catches the event when the map is moved.
The MapViewCameraChangedEvent catches the event when the map is moved. This can be used when in Fixed Cursor Mode on the Stereo Map. Unfortunately, the camera only returns the x and y, not the z.
I tried the OnToolMouseMoveEvent in a MapTool again (see above), and now (in ArcGIS Pro 3.4), it catches the event when the z-value of the cursor changes!