I am currently disaply over 500 pushpins on my bing map using the below code. Loading 开发者_如何学Cof these pushpins is causing a serious lag on the UI, so I was wondering if it is possible to load these incrementally based on the users position, but still use this code?
I have seen other examples using bindings and obseravable collections, but I would like to find a solution for the below code if possible.
foreach (var root in Transitresults)
{
var pin = new Pushpin
{
Location = new GeoCoordinate
{
Latitude = root.Lat,
Longitude = root.Lon
},
Background = accentBrush,
Content = root.Name,
Tag = root,
};
BusStopLayer.AddChild(pin, pin.Location);
}
Check out this post, It's a good tutorial on only showing the pins that are actually in view:
Awkward Coder: How many pins can Bing Maps handle in a WP7 app
精彩评论