无法在Windows Phone 8.1中向地图添加图钉:
<Maps:MapControl x:Name="RestoMap" MapServiceToken="" Height="550" Margin="0,60,0,0" Width="380">
<Maps:MapItemsControl x:Name="MapPins">
<Maps:MapItemsControl.ItemTemplate>
<DataTemplate>
<Maps:MapElement >
</Maps:MapElement>
</DataTemplate>
</Maps:MapItemsControl.ItemTemplate>
</Maps:MapItemsControl>
</Maps:MapControl>
代码:正确检索坐标
foreach (var item in AllResto)
{
String id = item.id;
Double latitude = item.latitude;
Double longitude = item.longitude;
AllSavedPins.Add(new Data(id, latitude, longitude));
}
MapPins.ItemsSource = this.AllSavedPins;
答案 0 :(得分:0)
你可以做::
foreach(var pin in AllSavedPins)
{
RestoMap.Children.Add(pin);
}