Пример #1
0
        /// <summary>
        /// 骑行路径规划
        /// </summary>
        /// <param name="planParam">规划路径参数</param>
        /// <returns>路径规划结果</returns>
        public string BicyclingOriginalPlanning(BicyclingPlanParam planParam)
        {
            string getUrl = GaoDeConst.WebAPIHost + "/v4/direction/bicycling?{0}";
            string paras  = planParam.GenerateParams();

            getUrl = string.Format(getUrl, paras);
            string planResult = WebRequestHelper.HttpGet(getUrl);

            return(planResult);
        }
Пример #2
0
        /// <summary>
        /// 骑行路径规划
        /// </summary>
        /// <param name="planParam">规划路径参数</param>
        /// <returns>路径规划结果</returns>
        public BicyclingPlanResult BicyclingPlanning(BicyclingPlanParam planParam)
        {
            planParam.output = "JSON";
            string jsonResult = BicyclingOriginalPlanning(planParam);

            if (!string.IsNullOrWhiteSpace(jsonResult))
            {
                jsonResult = jsonResult.Replace("[]", "\"\"");
            }
            BicyclingPlanResult planResult = JsonConvert.DeserializeObject <BicyclingPlanResult>(jsonResult);

            return(planResult);
        }