地図上に画鋲を表示しようとしていますが、画鋲がたくさんあるので、地図の表示可能領域内にある画鋲だけを表示したいので、地図の応答性が向上するはずです。
クエリからデータベースへのxyポイントのリストを取得します。これは私がこれまでに持っているコードです。
List<Pushpin> ListofPoints = new List<Pushpin>();
foreach (var element in query)
{
//Add a pin to the map
Pushpin pushpin = new Pushpin();
Location location = new Location();
location.Latitude = Convert.ToDouble(element.X);
location.Longitude = Convert.ToDouble(element.Y);
pushpin.Location = location;
ListofPoints.Add(pushpin);
map1.Children.Add(pushpin);
}
// Position map based on a collection of Pushpins points
var x = from l in ListofPoints
select l.Location;
map1.SetView(LocationRect.CreateLocationRect(x));
ListofPoints.Clear();
マップの表示可能領域にのみポイントを表示する方法について、誰かがアドバイス/コードを教えてもらえますか?
ありがとう