0
我有在把一個標記,以便在我的兵地圖的每個位置的問題,這是我的代碼:Multimarkers在Bing地圖
private async void geolocator_PositionChanged(Geolocator sender, PositionChangedEventArgs args)
{
await
// Need to get back onto UI thread before updating location information
this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(
async() =>
{
UriString4 = "my URL";
var http = new HttpClient();
http.MaxResponseContentBufferSize = Int32.MaxValue;
var response = await http.GetStringAsync(UriString4);
var rootObject = JsonConvert.DeserializeObject<NvBarberry.Models.RootObject>(response);
Location[] location = new Location[int.Parse(rootObject.total)];
for (int i = 0; i < int.Parse(rootObject.total); i++)
{
//Get the current location
location[i] = new Location(rootObject.locals[i].local_latit,rootObject.locals[i].local_longi);
//Update the position of the GPS pushpin
MapLayer.SetPosition(GpsIcon, location[i]);
//Set the radius of the Accuracy Circle
GpsIcon.SetRadius(args.Position.Coordinate.Accuracy);
//Make GPS pushpin visible
GpsIcon.Visibility = Windows.UI.Xaml.Visibility.Visible;
//Update the map view to the current GPS location
MyMap.SetView(location[i], 17);
}
}));}
這是我想要得到local_longi JSON數據和 local_latit每個地點:
{
success : 1,
total : 2,
locals : [{
id_local : "59",
local_longi : "20",
local_latit : "25894"
}, {
id_local : "60",
local_longi : "10.33699",
local_latit : "25.997745"
}
]
}
的問題是,我得到的地圖,這是從經度,Lattitude最後一個位置上只有一個標記(根據塔JSON數據我得在地圖上只有位置。這個值:
local_longi: "10.33699",
local_latit: "25.997745"
我得到了「位置」變量,爲什麼我在地圖只得到一個標記的所有結果
這是教程,我遵循: https://blogs.bing.com/maps/2012/11/05/getting-started-with-bing-maps-windows-store-apps-native/
更新: 這是對我的地圖XAML代碼:
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<m:Map Name="MyMap" Credentials="1m8dxWklva2lte3kYjkn~........" ZoomLevel="13" />
<CheckBox Content="GPS" Click="GPS_Checked"/>
</Grid>