0

I am using sim connect and I am wanting to place a custom marker on my map I am using the excellent Gmap.net https://github.com/judero01col/GMap.NET however getting the plane to the side of the runway as shown in the second image and how do i show the plane in proper direction of the runway ie how do i rotate it.

GMapMarker marker = new GMarkerGoogle(new PointLatLng(latitude, longitude), new 
Bitmap(AirManagerResources.Plane));

gMapOverlay.Markers.Add(marker);
gMapControl1.Overlays.Add(gMapOverlay);   // overlay added
          

This works fine and places the plane near the runway however I wish the image to be rotated in the direction of the gps coordinates how would one do that. So the plane should be on the runway here and not to the side.

enter image description here

enter image description here

c-sharp-and-swiftui-devni
  • 3,743
  • 4
  • 39
  • 100
  • Use bearing/heading instead of lat/lng. Rotating a GMap.NET [marker is explained here](https://stackoverflow.com/questions/40120376/how-to-rotate-gmap-net-marker-in-c-sharp). – nilsK Dec 15 '20 at 13:52
  • @nilsK the code their is incomplete I already tried that solution – c-sharp-and-swiftui-devni Dec 15 '20 at 13:54
  • Unfortunate. But did i got you right? You need to [rotate your bitmap](https://stackoverflow.com/questions/2225363/c-sharp-rotate-bitmap-90-degrees) and heading is your rotating degree? – nilsK Dec 15 '20 at 14:00
  • Use a class object to describe your Marker, add the Heading as a parameter (if you just need the nose inclination in relation to the absolute north), then apply the angle using [Matrix.RotateAt](https://learn.microsoft.com/en-us/dotnet/api/system.drawing.drawing2d.matrix.rotateat) (the angle is expressed in degrees, relative to the *North*, clock-wise), using the center of your Image as the Point origin of the rotation. If in-flight, you probably have the bearing / relative bearing to consider, but that doesn't change the Bitmap rotation, just the true direction. – Jimi Dec 15 '20 at 15:24

0 Answers0