调用百度地图API
百度地图开发文档地址:http://lbsyun.baidu.com/index.php?title=jspopular3.0
我申请的秘钥:ycawI3hjWts4zQ0Et4O0GyxXfI5jWF6b
zM2RKSEjDrpFwwuhQ84gdLfls57asX20
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=ycawI3hjWts4zQ0Et4O0GyxXfI5jWF6b"></script> <style> /* 地图容器样式 */ #container{ width:100%; height:500px; } </style> </head> <body> <div id="container"></div> <script> // 创建地图实例 var map = new BMap.Map("container"); // 设置中心坐标点 var point = new BMap.Point(116.404, 39.915); //这里设置成天安门的坐标 // 地图初始化 设置中心坐标及地图级别 map.centerAndZoom(point, 15); //开启鼠标滚轮缩放 map.enableScrollWheelZoom(true); var marker = new BMap.Marker(point);// 创建标注 map.addOverlay(marker);// 将标注添加到地图中 // 4000后地图的中心点移动到新的中心点 window.setTimeout(function(){ map.panTo(new BMap.Point(116.409, 39.918)); }, 4000); </script> </body> </html>
了解更多请查看文档
。
相关推荐
etzt 2020-04-16
etzt 2020-01-06
worldkun 2019-12-20
jishume 2011-07-19
xcjing 2015-11-12
XiaoyiXie 2019-04-25
xiaoshe 2014-07-10
蓝色诱惑 2014-07-10
zmosquito 2016-11-21
zmosquito 2015-05-20
nutian 2016-07-04
chang00 2013-05-02
bingxingke 2013-01-28
zmosquito 2013-01-23
semjinghua 2012-12-14
geminihr 2012-11-14
bingxingke 2012-05-17
channeldotren 2018-01-26
qrcwkt 2017-11-06