Select to view content in your preferred language

How to set mouse position in Stereo Map

398
0
10-02-2023 04:40 AM
BarbaraSchneider2
Frequent Contributor

When the regular map is active, I use the following code to make the mouse jump to a specified position:

QueuedTask.Run(() =>
{
  MapPoint mapPoint = MapPointBuilderEx.CreateMapPoint(x, y, spatialRef);
  System.Windows.Point cursorPoint = MapView.Active.MapToScreen(mapPoint);
  System.Windows.Forms.Cursor cursor = new Cursor(Cursor.Current.Handle);
  Cursor.Position = new System.Drawing.Point((int)cursorPoint.X, (int)cursorPoint.Y);
});

When the Stereo Map is active and I use the same code as above, I get three problems:

1. I cannot specify the z-value

2. The mouse doesn't jump to the correct position on the Stereo Map

3. The position where the mouse jumps to is different each time I change the z-value of the mouse

Is there another way to set the mouse position in the StereoMap in the Pro SDK? I haven't found anything.

0 Kudos
0 Replies