Beispiel #1
0
 private void aMapControl_LoadingStatusChanged(AMapControl sender, AMapLoadingStatus args)
 {
     if (args == AMapLoadingStatus.Loaded)
     {
         Debug.WriteLine("Loaded!");
     }
 }
        public Gesture()
        {
            this.InitializeComponent();
            aMapControl = new AMapControl();
            aMapControl.AllGesturesEnabled = false;


            ContentGrid.Children.Add(aMapControl);
        }
        public ForeGroundControls()
        {
            this.InitializeComponent();
            aMapControl = new AMapControl();
            aMapControl.ScaleControlEnabled   = false;
            aMapControl.ZoomControlEnabled    = false;
            aMapControl.CompassControlEnabled = false;

            ContentGrid.Children.Add(aMapControl);
        }
Beispiel #4
0
        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";
            }
        }
Beispiel #5
0
 void AMapControlZoomLevelChanged(AMapControl sender, object args)
 {
     zoomlevel.Text = "zoomlevel" + aMapControl.ZoomLevel;
 }
Beispiel #6
0
 void AMapControlHeadingChanged(AMapControl sender, object args)
 {
     heading.Text = "heading" + aMapControl.Heading;
 }
Beispiel #7
0
 void AMapControlPitchChanged(AMapControl sender, object args)
 {
     pitch.Text = "pitch:" + aMapControl.DesiredPitch;
 }
Beispiel #8
0
 void AMapControlCenterChanged(AMapControl sender, object args)
 {
     center.Text = "center:" + aMapControl.Center;
 }
        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;
            }
        }
Beispiel #10
0
 void aMapControl_MapDoubleTapped(AMapControl sender, AMapInputEventArgs args)
 {
     eventTextBlock.Text = "event is doubletapped";
     lon.Text            = args.Location.Longitude.ToString();
     lat.Text            = args.Location.Latitude.ToString();
 }
Beispiel #11
0
 void aMapControl_MapHolding(AMapControl sender, AMapInputEventArgs args)
 {
     eventTextBlock.Text = "event is holding";
     lon.Text            = args.Location.Longitude.ToString();
     lat.Text            = args.Location.Latitude.ToString();
 }
 private void aMapControl_Holding(AMapControl sender, AMapInputEventArgs args)
 {
     aMapControl.HideInfoWindow();
 }