Esempio n. 1
0
        /// <summary>
        /// 获取所有兴趣点
        /// </summary>
        /// <param name="location"></param>
        /// <param name="projectId"></param>
        /// <returns></returns>
        public static List <LNKPAppendage> GetAllAppendage(string location, int projectId)
        {
            loadData();

            list = SYSCityApi.GetAllCity();

            //rq.location = "22.55932,114.04508";
            List <LNKPAppendage> lnkpaList = new List <LNKPAppendage>();

            try
            {
                rq.location = location;
                string[] queryArray = rq.query.Split('$');
                for (int t = 0; t < queryArray.Length; t++)
                {
                    rq.page_num = 0;
                    rq.query    = queryArray[t];

                    //分页获取
                    PlaceResponse rs = BaiduAPI.PlaceAPIManger.SearchPOI(rq);
                    BaiduApiManager.FullAppendage(rs, projectId, rq.query, lnkpaList);
                    if (rs.total > 20)
                    {
                        int pageTotal = rs.total / 20;
                        for (int i = 1; i < pageTotal + 1; i++)
                        {
                            rq.page_num = i;
                            PlaceResponse rs2 = BaiduAPI.PlaceAPIManger.SearchPOI(rq);
                            BaiduApiManager.FullAppendage(rs2, projectId, rq.query, lnkpaList);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
                lnkpaList = new List <LNKPAppendage>();
            }

            return(lnkpaList);
        }
Esempio n. 2
0
        public static List <FxtApi_SYSCity> GetAllCity()
        {
            List <FxtApi_SYSCity> list = SYSCityApi.GetAllCity();

            return(list);
        }