Beispiel #1
0
 private void Initialize()
 {
     AnalyticalData          = new AnalyticalData();
     NavigateBackwardCommand = new DelegateCommand(Backward);
     NavigateForwardCommand  = new DelegateCommand(Forward);
     NavigateLeftCommand     = new DelegateCommand(ScrollToLeft);
     NavigateRightCommand    = new DelegateCommand(ScrollToRight);
     CurrentDisplayOrders    = new ObservableCollection <Order>();
     TotalOrders             = new ObservableCollection <Order>();
     this.IsEnabled          = false;
 }
Beispiel #2
0
        private AddressComponent GetGeocoderForPositionByBaidu(double latitude, double longitude)
        {
            //Console.WriteLine("Latitude: {0}, Longitude {1}", latitude, longitude);
            //********http://api.map.baidu.com/geocoder?location=24.363,109.402&output=json&key=elxrPCAh6eQyyBwqk62NGpKMxhTh1az1

            string staticAddress = "http://api.map.baidu.com/geocoder?";
            string location      = string.Format("{0},{1}", latitude, longitude);

            string url = string.Format("{0}location={1}&output=json&key={2}", staticAddress, location, _ak);

            try
            {
                string           result  = GenerateUrl.Get(url);
                AddressComponent address = AnalyticalData.AnalyticalData_obj(result);
                return(address);
            }
            catch (Exception ex)
            {
                MessageBox.Show($"获取具体地址失败,请稍后右键任务栏小图标点击刷新!", "提示");
                return(null);
            }
        }