1

地図上に画鋲を表示しようとしていますが、画鋲がたくさんあるので、地図の表示可能領域内にある画鋲だけを表示したいので、地図の応答性が向上するはずです。

クエリからデータベースへの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();

マップの表示可能領域にのみポイントを表示する方法について、誰かがアドバイス/コードを教えてもらえますか?

ありがとう

4

1 に答える 1

1

ViewChangeStartおよびイベントを使用しViewChangeEndて変更後の現在のビューを取得し、データセットを再クエリして、必要に応じて表示されているピンを更新します。

于 2011-07-12T23:23:28.463 に答える