void aMapControl_MapTapped(AMapControl sender, AMapInputEventArgs args) { eventTextBlock.Text = "event is tapped"; lon.Text = args.Location.Longitude.ToString(); lat.Text = args.Location.Latitude.ToString(); if (args.AMapIcon != null) { mapiconTestblock.Text = "点击到了icon,他的经纬度为" + args.AMapIcon.Location; } else { mapiconTestblock.Text = "没有点击到icon"; } }
private async void aMapControl_MapTapped(AMapControl sender, AMapInputEventArgs args) { AMapReGeoCodeResults results = await AMapReGeoCodeSearch.GeoCodeToAddress(args.Location.Longitude, args.Location.Latitude, 500, "", Extensions.All); //todo 一下坐标存在问题 //var error1 = new LngLat(116.251101, 39.836455); //AMapReGeoCodeResults results = await AMapReGeoCodeSearch.GeoCodeToAddress(error1.Longitude, error1.Latitude, 500, "", Extensions.All); if (results.Erro == null) { if (results.ReGeoCode == null) { addressOutputTextblock.Text = "返回为null"; return; } AMapReGeoCode regeocode = results.ReGeoCode; Debug.WriteLine(regeocode.Address_component); Debug.WriteLine(regeocode.Formatted_address); Debug.WriteLine(regeocode.Pois); List <AMapPOI> pois = regeocode.Pois.ToList(); //POI信息点 foreach (AMapPOI poi in pois) { Debug.WriteLine(poi.Address); } Debug.WriteLine(regeocode.Roadinters); Debug.WriteLine(regeocode.Roadslist); AMapAddressComponent addressComponent = regeocode.Address_component; //todo building //Debug.WriteLine(addressComponent.Building); Debug.WriteLine(addressComponent.City); Debug.WriteLine(addressComponent.District); //todo 邻居 //Debug.WriteLine(addressComponent.Neighborhood); Debug.WriteLine(addressComponent.Province); Debug.WriteLine(addressComponent.Stree_number); Debug.WriteLine(addressComponent.Township); AMapStreetNumber streetNumber = addressComponent.Stree_number; Debug.WriteLine(streetNumber.Direction); Debug.WriteLine(streetNumber.Distance); Debug.WriteLine(streetNumber.Location.Lat); Debug.WriteLine(streetNumber.Location.Lon); Debug.WriteLine(streetNumber.Number); Debug.WriteLine(streetNumber.Street); addressOutputTextblock.Text = regeocode.Formatted_address; aMapControl.TrySetViewAsync(args.Location); } else { addressOutputTextblock.Text = results.Erro.Message; } }
void aMapControl_MapHolding(AMapControl sender, AMapInputEventArgs args) { eventTextBlock.Text = "event is holding"; lon.Text = args.Location.Longitude.ToString(); lat.Text = args.Location.Latitude.ToString(); }
void aMapControl_MapDoubleTapped(AMapControl sender, AMapInputEventArgs args) { eventTextBlock.Text = "event is doubletapped"; lon.Text = args.Location.Longitude.ToString(); lat.Text = args.Location.Latitude.ToString(); }
private void aMapControl_Holding(AMapControl sender, AMapInputEventArgs args) { aMapControl.HideInfoWindow(); }