Beispiel #1
0
        public PoiPushpin(PointOfInterest poi)
        {
            Pushpin = new Microsoft.Phone.Controls.Maps.Pushpin();

            PointOfInterest = poi;

            Comments = new ObservableCollection<Comment>();
            Tags = new ObservableCollection<string>();
        }
        void SharedLandmarksDownloadComplete(object sender, DownloadStringCompletedEventArgs e)
        {
            JArray cmts = JArray.Parse(e.Result);

            PointGroup dg = e.UserState as PointGroup;

            if (dg != null)
            {

                List<PointOfInterest> p = new List<PointOfInterest>();

                foreach (var obj in cmts.Children())
                {
                    JObject o = JObject.Parse(obj.ToString());
                    PointOfInterest poi = new PointOfInterest();
                    poi.Id = (string)o.SelectToken("Guid");
                    poi.IconUri = new Uri("http://vanguide.cloudapp.net/Images/CommunityPoint.png");
                    poi.Selectable = true;
                    poi.Description = (string)o.SelectToken("Description");
                    string lat = o.SelectToken("Latitude").ToString();
                    string lng = o.SelectToken("Longitude").ToString();
                    poi.Coordinates = string.Format("{0}, {1}", lng, lat);


                    p.Add(poi);
                }

                dg.Points = p;

                dg.AddPinsToLayer();

                dg.Loaded = true;


            }
        }