php百度地圖api
⑴ 百度地圖Place API返回poi數據不全怎麼解決
用php寫後台程序,連接資料庫! /wiki/static/map/API/examples/?v=1.3&3_0#3&0裡面的自家數據+前端搜索可供參考!網路地圖Place API返回poi數據不全怎麼解決
⑵ PHP緗戠珯涓錛屽氫釜閾炬帴璋冪敤涓涓鍦板浘銆傘傘傘傝В鍐寵繃鍚庨珮鍒嗘偓璧
涓嶇煡閬撲綘鍏蜂綋鐨勮佹眰濡備綍銆傛槸姣忔$偣鍑諱竴涓閾炬帴錛屽氨鍦ㄥ湴鍥句笂鏄劇ず璇ラ摼鎺ユ墍鎸囩殑鍦板潃錛堝湴鍥撅級鍚楋紵濡傛灉鏄榪欐牱瀛愮殑璇濓紝搴旇ュ彲浠ヤ嬌鐢ㄧ櫨搴︺佽胺姝屼粬浠鐨勫湴鍥続PI鍒涘緩涓涓銆傛垜鐢ㄧ櫨搴﹀湴鍥句婦涓渚嬪瓙錛屼綘鍙浠ョ湅鐪嬶細
銆愪唬鐮併
<style type="text/css">
#J-bdmap { width:500px; height:200px; border:1px solid #ccc; }
</style>
<div class="points"> <a href="#" onclick="return loadPoint(120.147403,30.231107);">澶瀛愭咕鍏鍥</a> | <a href="#" onclick="return loadPoint(120.156242,30.237222);">闆峰嘲濉</a> | <a href="#" onclick="return loadPoint(120.145391,30.246832);">鑻忓牑</a></div>
<div id="J-bdmap"></div>
<!-- 寮曞叆鐧懼害鍦板浘API -->
<script src="http://api.map..com/api?v=1.4" type="text/javascript"></script>
<script>
window.onload=function(){
BMapObj = new BMap.Map("J-bdmap"); // 鍦ㄩ〉闈㈠姞杞藉畬鎴愬悗錛屽壋寤轟竴涓鍦板浘瀵硅薄錛
// 璁劇疆榛樿ゆ樉紺轟綅緗鐨勫潗鏍囷紝榪欓噷鏄鏉宸炵殑銆
var point = new BMap.Point(120.162099,30.279019);
// 涓澶鏄劇ず
BMapObj.centerAndZoom(point,12);
// 鏄劇ず鏍囪
BMapObj.addOverlay(new BMap.Marker(point));
}
// 鍔犺澆涓涓鍦板潃鍧愭爣
function loadPoint(x, y) {
var point = new BMap.Point(x, y);
if(point) {
BMapObj.centerAndZoom(point,16);
BMapObj.addOverlay(new BMap.Marker(point));
}
return false;
}
</script>
⑶ php根據經緯度獲取地理位置
這種功能,只能調用第三方的介面了,網路地圖API就有這個介面addressComponents,逆地址解析,參考方法如下:
<GeocoderSearchResponse>
<status>OK</status>
<result>
<location>
<lat>38.990998</lat>
<lng>103.645966</lng>
</location>
<formatted_address>甘肅省武威市民勤縣</formatted_address>
<business/>
<addressComponent>
<streetNumber/>
<street/>
<district>民勤縣</district>
<city>武威市</city>
<province>甘肅省</province>
</addressComponent>
<cityCode>118</cityCode>
</result>
</GeocoderSearchResponse>