From 53edd5e8ebc0eeaa23ab94b19df1f62886143043 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaiser Date: Wed, 10 Jul 2024 16:16:43 -0700 Subject: [PATCH] project to the map's spatial reference if it exists --- .../GeometryControl/GeometryViewDockpaneViewModel.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Editing/GeometryControl/GeometryViewDockpaneViewModel.cs b/Editing/GeometryControl/GeometryViewDockpaneViewModel.cs index 42c66525..e58bd323 100644 --- a/Editing/GeometryControl/GeometryViewDockpaneViewModel.cs +++ b/Editing/GeometryControl/GeometryViewDockpaneViewModel.cs @@ -85,8 +85,14 @@ private async void OnSelectionChanged(ArcGIS.Desktop.Mapping.Events.MapSelection return insp.Shape; }); - // bind to the view - Geometry = geom; + // project to the map's spatial reference if it exists + var map = MapView.Active?.Map; + var sr = map?.SpatialReference; + if (sr != null) + geom = GeometryEngine.Instance.Project(geom, sr); + + // bind to the view + Geometry = geom; } private Geometry _geometry;