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>