I'm trying to put an image according to its geopoints. However, the image does not show up on the map. I want to make sure that when we zoom in/out the map, the image will stay in place and adjust its size based on its fixed coordinate. Do i have to insert the image in the xaml page also? Currently I'm only adding image on the cs page.
can someone tell me how to fix this? MapView is MapControl in this code.
namespace HelpMe
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
addImage();
}
//adding image
public void addImage()
{
Image img = new Image();
img.Height = 100;
img.Width = 100;
img.Source = new BitmapImage(new Uri("ms-appx:///Assets/Unknown.jpg"));
img.RenderTransform = new CompositeTransform() { Rotation = 0 };
MapControl.SetNormalizedAnchorPoint(img, new Point(0.5, 0.5));
MapControl.SetLocation(img, new Geopoint(new BasicGeoposition() { Latitude = 0, Longitude = 0, Altitude = 0 }));
MapView.Children.Add(img);
}
}
}