Пример #1
0
        public void testGetLocation() {
            var param = new GetLocationParam() {
                ak = "kA567D1jdRe98uouVbfISI189mqGX6G8",
                output = Output.JSON,

                address = "豫园",
                city = City.Shanghai,
                callback = ""
            };

            // lng: 121.4988796536, lat: 31.2328788004
            var result = BaiduMapUtil.getLocation(param);
        }
Пример #2
0
        /// <summary>
        /// 根据地址信息获得经纬度
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public static string getLocation(GetLocationParam param) {
            var baseUrl = "http://api.map.baidu.com/geocoder/v2/";
            var result = get(baseUrl, param);

            return result;
        }