My app is moving a vehicle on specified route using below code. But the image of vehicle used is like it's front side is facing to left. How can I rotate the face of car on the way it goes? I'm referring this link to move the car.
My Code :
private void MovePinOnPath(bool isGeodesic)
{
Image forImage = new Image
{
Width = 40,
Source = CarIconSource,
};
BasicGeoposition geoposition = new BasicGeoposition();
geoposition.Latitude = CarDetailsList.CodeArray[Startpt_index].CarLat;
geoposition.Longitude = CarDetailsList.CodeArray[Startpt_index].CarLng;
Geopoint mypoint2 = new Geopoint(geoposition);
List<BasicGeoposition> GeoList = new List<BasicGeoposition>();
for (int i = Startpt_index + 1; i <= Endpt_index; i++)
{
GeoList.Add(new BasicGeoposition()
{
Latitude = CarDetailsList.CodeArray[i].CarLat;
Longitude = CarDetailsList.CodeArray[i].CarLng;
});
}
Geopath path3 = new Geopath(GeoList);
MapControl.SetLocation(forImage, mypoint2);
MapControl.SetNormalizedAnchorPoint(forImage, new Point(0.5, 1.0));
currentAnimation = new PathAnimation(path3, (coord, pathIdx, frameIdx) =>
{
MapControl.SetLocation(forImage, new Geopoint(coord));
}, isGeodesic, 10000);
currentAnimation.Play();
}