Parameters
- features
- A set of features to rotate
- origin
- The origin around which the geometry will be rotated.
- angle
- The rotation angle in radians
var rotateFeatures = new EditOperation(); rotateFeatures.Name = "Rotate Features"; //Rotate works on a selected set of features //Get all features that intersect a polygon //at 2.x - var rotateSelection = MapView.Active.GetFeatures(polygon).Select( // k => new KeyValuePair<MapMember, List<long>>(k.Key as MapMember, k.Value)); //rotateFeatures.Rotate(rotateSelection, origin, Math.PI / 2); //Rotate selected features 90 deg about "origin" rotateFeatures.Rotate(MapView.Active.GetFeatures(polygon), origin, Math.PI / 2); //Execute to execute the operation //Must be called within QueuedTask.Run if (!rotateFeatures.IsEmpty) { var result = rotateFeatures.Execute(); //Execute and ExecuteAsync will return true if the operation was successful and false if not } //or use async flavor //await rotateFeatures.ExecuteAsync();
Target Platforms: Windows 11, Windows 10