我想通过用一个函数替换硬编码的偏移值来旋转多边形(例如这个箭头),在这个函数中可以传入北指向偏移和我希望箭头旋转的度数。
我尝试使用旋转矩阵,但效果不佳。
可能是因为 1 Lat 的距离。!= 1 长。
我试图用这个做什么:
箭头必须代表车辆并在车辆前进的方向上旋转。
double centerLatitude = pos.Coordinate.Point.Position.Latitude;
double centerLongitude = pos.Coordinate.Point.Position.Longitude;
MapPolygon mapPolygon = new MapPolygon();
mapPolygon.Path = new Geopath(new List<BasicGeoposition>() {
new BasicGeoposition() {Longitude=centerLongitude, Latitude=centerLatitude},//top of the arrow
new BasicGeoposition() {Longitude=centerLongitude-0.001, Latitude=centerLatitude-0.0010},
new BasicGeoposition() {Longitude=centerLongitude-0.001, Latitude=centerLatitude-0.0030},
new BasicGeoposition() {Longitude=centerLongitude+0.001, Latitude=centerLatitude-0.0030},
new BasicGeoposition() {Longitude=centerLongitude+0.001, Latitude=centerLatitude-0.0010},
});
mapPolygon.ZIndex = 1;
mapPolygon.FillColor = Colors.Orange;
mapPolygon.StrokeColor = Colors.Blue;
mapPolygon.StrokeThickness = 2;
mapPolygon.StrokeDashed = false;
MainMap.MapElements.Add(mapPolygon);