首先在百度地圖開放平臺申請 AK
1.根據(jù)地址經(jīng)緯度獲取標志建筑物
$result = json_decode(file_get_contents("http://api.map.baidu.com/geocoder/v2/?ak=" . MAP_AK . '&location=' . $lat . ',' . $lng . '&output=json&pois=1&coordtype=' . $coordtype),true);
2.獲取地址經(jīng)緯度
$result = json_decode(file_get_contents("http://api.map.baidu.com/geocoder/v2/?address=" . $keyword ."&output=json&ak=" . MAP_AK),true);
3.關(guān)鍵字獲取地址信息
$result = json_decode(file_get_contents("http://api.map.baidu.com/place/v2/search?q=" . $keyword ."®ion=". $region . "&page_num=" . $curpage . "&page_size=" . $page ."&output=json&ak=" . MAP_AK),true);