Skip to content

Commit

Permalink
project to the map's spatial reference if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf-K committed Jul 10, 2024
1 parent 5202b7a commit 53edd5e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Editing/GeometryControl/GeometryViewDockpaneViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 53edd5e

Please sign in to comment.