1.根據地址取得經緯度:
請求地址:http://api.map.baidu.com/geocoder/v2/?address=中國成都人才市場&output=json&ak=你的ak
返回結果: {"status":0,"result":{"location":{"lng":104.06552381979525,"lat":30.68093376455154},"precise":1,"confidence":70,"level":"UNKNOWN"}}
2.根據經緯度取得地址:
請求地址: http://api.map.baidu.com/geocoder/v2/?callback=renderReverse&location=30.68093376455154,104.06552381979525&output=json&pois=1&ak= 你的ak
返回結果:
renderReverse&&renderReverse({"status":0,"result":{"location":{"lng":104.0655238197952,"lat":30.680933634264947},"formatted_address":"四川省成都市青羊區寧夏街160號","business":"騾馬市,新華西路,八寶街","addressComponent":{"country":"中國","country_code":0,"province":"四川省","city":"成都市","district":"青羊區","adcode":"510105","street":"寧夏街","street_number":"160號","direction":"附近","distance":"5"},"pois":[{"addr":"寧夏街136號附1號","cp":" ","direction":"附近","distance":"44","name":"人才大廈","poiType":"房地產","point":{"x":104.06570195377788,"y":30.68123929976142},"tag":"房地產;寫字樓","tel":"","uid":"9f97b1c55d348507b64f54c4","zip":""},{"addr":"寧夏街136號","cp":" ","direction":"附近","distance":"37","name":"成都市人才流動服務中心","poiType":"政府機構","point":{"x":104.06560314017178,"y":30.681216006133047},"tag":"政府機構;行政單位","tel":"","uid":"a431a82c02ae3a90d2f49eec","zip":""},{"addr":"四川省成都市青羊區寧夏街136號附1號人才大廈","cp":" ","direction":"附近","distance":"46","name":"中國成都人才市場","poiType":"公司企業","point":{"x":104.06566602155748,"y":30.681270357923777},"tag":"公司企業;公司","tel":"","uid":"251374c9ad16f33ea11de9f7","zip":""},{"addr":"四川省成都市青羊區西大街1號","cp":" ","direction":"東北","distance":"201","name":"成都新城市廣場","poiType":"購物","point":{"x":104.06397720719872,"y":30.6801211991978},"tag":"購物;購物中心","tel":"","uid":"7aea43b7568f9ae17d29bdf6","zip":""},{"addr":"成都市西大街1號新城市廣場A棟2樓","cp":" ","direction":"東北","distance":"117","name":"太平洋影城(新城市店)","poiType":"休閑娛樂","point":{"x":104.0648216143781,"y":30.68025319786169},"tag":"休閑娛樂;電影院","tel":"","uid":"fa7da3e81fc87a7b42d63e24","zip":""},{"addr":"萬和路99號","cp":" ","direction":"西","distance":"97","name":"麗陽天下","poiType":"房地產","point":{"x":104.06639364902056,"y":30.681045186018193},"tag":"房地產;住宅區","tel":"","uid":"101bc61b807557dec42ba16c","zip":""},{"addr":"寧夏街200號新城市廣場A座5樓","cp":" ","direction":"東北","distance":"99","name":"生活家家居集團成都分公司","poiType":"公司企業","point":{"x":104.0649473771495,"y":30.68033860866474},"tag":"公司企業;公司","tel":"","uid":"6348ee6b13dda375d12dd655","zip":""},{"addr":"萬和路11號","cp":" ","direction":"西北","distance":"135","name":"成都市青羊區國稅局","poiType":"政府機構","point":{"x":104.06633076763487,"y":30.6801444930929},"tag":"政府機構;行政單位","tel":"","uid":"aa40108bb0301c14c5effbca","zip":""},{"addr":"青羊區萬和路100號","cp":" ","direction":"西南","distance":"207","name":"德陽銀行(成都萬和路支行)","poiType":"金融","point":{"x":104.06706737815304,"y":30.681837167614427},"tag":"金融;銀行","tel":"","uid":"cfd60c585e1ca3bb9d9d68ce","zip":""},{"addr":"成都市青羊區西大街1號","cp":" ","direction":"東北","distance":"211","name":"百盛購物中心(四川時尚店)","poiType":"購物","point":{"x":104.06404907163952,"y":30.67990378923652},"tag":"購物;購物中心","tel":"","uid":"251374c95826c626a11de9df","zip":""}],"poiRegions":[],"sematic_description":"人才大廈附近44米","cityCode":75}})
附:
ak查看地址:http://lbsyun.baidu.com/apiconsole/key