0

Windows phone 7 の bing マップ コントロールを使用しており、エミュレータでのみポリライン プロットを使用しています。デバイスで実行しても何も起こりません...

XDocument doc = XDocument.Parse(getRoute1());  //private string getRoute1() return gpx file
var ns = doc.Root.GetDefaultNamespace();
var loc = doc.Descendants()
   .Where(el => el.Name == ns + "wpt" || el.Name == ns + "trkpt")
   .Select(trkpt =>
   new Location
   {
        Latitude = double.Parse(trkpt.Attribute("lat").Value),
        Longitude = double.Parse(trkpt.Attribute("lon").Value)
    }).ToLocationCollection();
mapPolyline.Locations = loc;
maps.Children.Add(mapPolyline);
4

1 に答える 1

0
public MainPage()
        {
            InitializeComponent();
            double[] lattitudes = { 50.21934078740, 33.563511, 19.511719, 25.3125 };
            double[] longitudes = { 23.0518068854053, 35.368259, -14.43468, 67.542167 };
            this.DrawPolyLine(lattitudes, longitudes);   

        }

            private void DrawPolyLine(double []lat, double[]longi)
        {

            MapPolyline line = new MapPolyline();
             line.Stroke = new SolidColorBrush(Colors.Brown);
            line.StrokeThickness = 3;
            line.Locations = new LocationCollection();
            for (int i=0;i<4;i++){
                line.Locations.Add(new Location(lat[i], longi[i]));

                Pushpin p = new Pushpin();

                p.Location = new Location(lat[i], longi[i]);

                map1.Children.Add(p);
            }
                 map1.Children.Add(line);
         }
于 2013-06-24T08:29:56.220 に答える