async void CenterlnglatAroundPOISearch() { ReverseGeocodingOption rgo = new ReverseGeocodingOption(); rgo.XCoors = new double[] { double.Parse(centerLng.Text) }; rgo.YCoors = new double[] { double.Parse(centerLat.Text) }; ReverseGeoCodingResult rgcs = await ReGeoCode.GeoCodeToAddressWithOption(rgo); if (rgcs.Erro == null) { Debug.WriteLine(rgcs); } else { Debug.WriteLine(rgcs.Erro.Message); } }
private async void ReGeoCodeTest(double lng, double lat) { ReverseGeocodingOption rgo = new ReverseGeocodingOption(); rgo.XCoors = new double[] { lng }; rgo.YCoors = new double[] { lat }; ReverseGeoCodingResult rgcs = await ReGeoCode.GeoCodeToAddressWithOption(rgo); this.Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { if (rgcs.Erro == null && rgcs.resultList != null) { IEnumerable<ReverseGeocodingInfo> reverseGeocodeResult = rgcs.resultList; foreach (ReverseGeocodingInfo poi in reverseGeocodeResult) { int i = 0; foreach (POI poilist in poi.Pois) { i++; AMarker marker = new AMarker(); marker.LngLat = new ALngLat(poilist.X, poilist.Y); ATip tip = new ATip(); tip.Title = i + ": " + poilist.Name; tip.ContentText = poilist.Address; marker.TipFrameworkElement = tip; markerList.Add(marker); map.Children.Add(marker); } } markerList[0].OpenTip(); map.SetOverlaysFitView(); } else { MessageDialog msd = new MessageDialog(rgcs.Erro.Message); this.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () => { msd.ShowAsync(); }); } }); }