MouseEventArg e.MapPoint: x: -9859018.61, y: 5184240.00, wkid: 102100
Screen coordinates: x: 347.00, y: 388.00
Host coordinates: x: 758.00, y: 542.00
Rect based on host visual: TopLeft: x: 758.00, y: 542.00, BottomRight: x: 778.00, y: 562.00
DrawBoundingBox: TopLeft: x: -9859018.61, y: 5184240.00, BottomRight: x: -9853218.29, y: 5178439.68
Found #6 graphics in the following GraphicsLayer: Testing_Scenario-gridfile_100x100
Graphic location of single point: x: -9852833.60, y: 5180831.17, wkid: 102100
Graphic location of single point: x: -9855351.87, y: 5180845.08, wkid: 102100
Graphic location of single point: x: -9857870.16, y: 5180858.34, wkid: 102100
Graphic location of single point: x: -9852847.99, y: 5178303.00, wkid: 102100
Graphic location of single point: x: -9855365.61, y: 5178316.90, wkid: 102100
Graphic location of single point: x: -9857883.24, y: 5178330.16, wkid: 102100
Rect based on host visual: TopLeft: x: 758.00, y: 542.00, BottomRight: x: 778.00, y: 562.00
Point p = map.PointFromScreen(new Point(x, y)); return map.ScreenToMap(p);
// Convert map coordinates to screen coordinates Point screenPoint = map.MapToScreen(e.MapPoint); // Convert map-screen coordinates to host coordinates Point hostPoint = map.PointToScreen(screenPoint); // print debug information Log.DebugFormat("Screen coordinates: x: {0:F2}, y: {1:F2}", screenPoint.X, screenPoint.Y); Log.DebugFormat("Host coordinates: x: {0:F2}, y: {1:F2}", hostPoint.X, hostPoint.Y); // Rectangle based on host coordinates. Rect rectMainVisual = new Rect(hostPoint.X, hostPoint.Y, diameter, diameter); IEnumerable<Graphic> gc = gl.FindGraphicsInHostCoordinates(rectMainVisual , 10);
Solved! Go to Solution.
// Rectangle based on host coordinates. Rect rectMainVisual = new Rect(hostPoint.X, hostPoint.Y, diameter, diameter);
// Rectangle based on host coordinates. Rect rectMainVisual = new Rect(hostPoint.X, hostPoint.Y, 0, 0); rectMainVisual.Inflate(diameter, diameter);
// Rectangle based on host coordinates. Rect rectMainVisual = new Rect(hostPoint.X, hostPoint.Y, diameter, diameter);
// Rectangle based on host coordinates. Rect rectMainVisual = new Rect(hostPoint.X, hostPoint.Y, 0, 0); rectMainVisual.Inflate(diameter, diameter);