一、準備工作
百度地圖開發文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Hello World</title>
<style type="text/css">
html{height:100%}
body{height:100%;margin:0px;padding: 0px}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=18w9Wpk8SKphulGgHbrsMKQV7ExOW1BS">
</script>
</head>
<body>
<h1>5464654456</h1>
<div id="container"></div>
<script type="text/javascript">
var map = new BMap.Map("container");
//建立地圖例項
var point = new BMap.Point(116.404,39.915);
//建立點座標
map.centerAndZoom(point,15);
//初始化地圖,設定中心點座標和地圖級別
</script>
</body>
</html>
複製程式碼
地圖api