如何显示MapIcon的图像?

时间:2015-02-09 21:13:01

标签: c# xaml windows-phone-8

我创建了一个MapIcon,并且使用Image属性从项目中插入了一个图像,但是我看不到图像,甚至是占位符的名称。 我哪里错了?

MapLocationFinderResult result = await MapLocationFinder.FindLocationsAsync(muss.Indirizzo,null);
Geopoint posizione1 = result.Locations.FirstOrDefault().Point;
MapIcon arrivo = new MapIcon();
arrivo.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Flag.png"));
arrivo.Location = posizione1;
arrivo.Title = muss.NomeMuseo;

MyMap.MapElements.Add(arrivo);

1 个答案:

答案 0 :(得分:0)

根据MapIcon class,它仅支持WP8.1 Runtime个应用。如果您使用的是WP8应用程序,那么为什么不为地图创建自定义Pushpin

Custom Pushpins,在这篇文章中找到第三个选项,讨论将图像作为Pushpin