I want to add an image on my MapControl. I have tried like below. But throws an exception
System.TypeLoadException: Requested Windows Runtime type 'Windows.UI.Xaml.Controls.Maps.MapElementsLayer' is not registered.
public void AddSpaceNeedleIcon()
{
var MyLandmarks = new List<MapElement>();
BasicGeoposition snPosition = new BasicGeoposition { Latitude = 47.620, Longitude = -122.349 };
Geopoint snPoint = new Geopoint(snPosition);
var spaceNeedleIcon = new MapIcon
{
Location = snPoint,
NormalizedAnchorPoint = new Point(0.5, 1.0),
ZIndex = 0,
Title = "Space Needle"
};
MyLandmarks.Add(spaceNeedleIcon);
var LandmarksLayer = new MapElementsLayer
{
ZIndex = 1,
MapElements = MyLandmarks
};
myMap.Layers.Add(LandmarksLayer);
myMap.Center = snPoint;
myMap.ZoomLevel = 14;
}
My Project's target version is : Windows 10 Fall Creators Update(10.0,Build 16299) Min version : windows 10 (10.0,Build 10240)