Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have multiple latitude and Longitude I need each and every one location name.`

C#
foreach (var item in Item[0].user)
                      {
                          AutoResetEvent done = new AutoResetEvent(true);
                          Uri uri = (new Uri("/Assets/Icons/default_image.png", UriKind.RelativeOrAbsolute));
                          Friend.Add(new FriendList { Name = item.firstname, Relationship = item.firstname == firstName ? "Self" : item.relationship, Image = item.prof_image_path == null ? uri.ToString() : item.prof_image_path, Date = item.date, Time = item.time, Id = item.id, Latitude = item.latitude, Longitude = item.longitude, EmailId = item.emailid });
                          ReverseGeocodeQuery query = new ReverseGeocodeQuery();
                          query.GeoCoordinate = new GeoCoordinate(Convert.ToDouble(item.latitude), Convert.ToDouble(item.longitude));
                          done.WaitOne();

                          query.QueryCompleted += (s,  e1) =>
                          {
                              if (e1.Error == null && e1.Result.Count > 0)
                              {
                                  string city = e1.Result[0].Information.Address.City;
                                  Friend.Where(se => se.Location == "null").ToList();
                                  Friend.ForEach(se => { if (se.Id == item.id) { se.Location = city; } });
                                  Longlist.RenderTransform = (Transform)new TranslateTransform();
                                  Storyboard.SetTarget((Timeline)doubleAnimation, (DependencyObject)Longlist.RenderTransform);
                                  Longlist.ItemsSource = Friend.ToList();
                                  loadingBar.IsVisible = false;
                                  LoadingCanvas.Visibility = Visibility.Collapsed;
                                  done.Set();
                              }

                          };
                          done.Reset();
                          query.QueryAsync();

                      }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900