开发者

Multiple Pushpin and UI Lag

开发者 https://www.devze.com 2023-04-07 04:25 出处:网络
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 t

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

0

精彩评论

暂无评论...
验证码 换一张
取 消