Beispiel #1
0
        /// <summary>
        /// 云图数据周边检索
        /// </summary>
        /// <param name="queryParam">周边检索参数</param>
        /// <returns>周边检索结果JSON</returns>
        public string AroundOriginalQuery(AroundSearchParam queryParam)
        {
            string getUrl = "https://yuntuapi.amap.com/datasearch/around?{0}";
            string paras  = queryParam.GenerateParam();

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

            return(jsonResult);
        }
Beispiel #2
0
        /// <summary>
        /// 云图数据周边检索
        /// </summary>
        /// <param name="queryParam">周边检索参数</param>
        /// <returns>周边检索结果对象</returns>
        public DataSearchResult AroundQuery(AroundSearchParam queryParam)
        {
            string jsonResult = AroundOriginalQuery(queryParam);

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

            return(queryResult);
        }