ハードコードされたオフセット値を、nordのオフセットオフセットと矢印を回転させたい度合いを渡すことができる関数に置き換えることによって、ポリゴン(この矢印など)を回転させたいとします。long/lat座標のマップ上でポリゴンを回転するにはどうすればよいですか?
私はRotation matrixを使用しようとしましたが、うまくいきませんでした。
おそらく距離が の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);
正確な答えではありませんが、おそらくそれが役立ちます。問題の変形として、行末に矢印の帽子を描く方法があります。 Lat/LonはX/Yになり、ポリゴンは矢頭になります。 math.stackexchange(http://math.stackexchange.com/questions/1314006/drawing-an-arrow)に素晴らしい記事が掲載されているかもしれません。 – MBulli
mapPolygonの代わりにxamlコントロールを使用することを検討しましたか?例えば。矢印付きの画像制御では、はるかに簡単です。 –
マップアイコンを使用しようとしましたが、マップを回転させたくありません。 – MatMis