BAIDU MAP 引用地图模块HTML
1–body部分插入
<div class=”lh-map” id=”baiduMap”></div>
2–以下是样式+接口文件
<style>#baiduMap img{width:auto !important; min-width:100% !important;}</style><script>window._bd_share_config={“common”:{“bdSnsKey”:{},”bdText”:””,”bdMini”:”1″,”bdMiniList”:false,”bdPic”:””,”bdStyle”:”0″,”bdSize”:”10″},”share”:{}};with(document)0[(getElementsByTagName(‘head’)[0]||body).appendChild(createElement(‘script’)).src=’http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=’+~(-new Date()/36e5)];</script><script type=”text/javascript” src=”/static/js/api-2.0_ny22a16GzbMDs1xHsTvjlqtZ.js”></script><script type=”text/javascript”>//创建地图var myMap=new BMap.Map(‘baiduMap’);var point=new BMap.Point(118.791304,32.032297);myMap.centerAndZoom(point,18);
//添加覆盖物var marker = new BMap.Marker(point); // 创建标注 myMap.addOverlay(marker); // 将标注添加到地图中
//添加控件myMap.addControl(new BMap.NavigationControl()); // 平移缩放myMap.addControl(new BMap.OverviewMapControl()); //缩略地图//myMap.enableScrollWheelZoom(); //滚轮缩放
</script>