注冊(cè)賬號(hào)并申請(qǐng)Key
1. 首先雁比,注冊(cè)開發(fā)者賬號(hào),成為高德開放平臺(tái)開發(fā)者
2. 登陸之后,在進(jìn)入「應(yīng)用管理」 頁面「創(chuàng)建新應(yīng)用」
3. 為應(yīng)用添加 Key钦幔,「服務(wù)平臺(tái)」一項(xiàng)請(qǐng)選擇「 Web 端 ( JSAPI )」
HELLO,AMAP常柄!
快速創(chuàng)建地圖
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>基本地圖展示</title>
<link rel="stylesheet" />
<script src="https://cache.amap.com/lbs/static/es5.min.js"></script>
<script src="https://webapi.amap.com/maps?v=1.4.8&key=ea7d2a225e7b68c30acfcd6b28cef0e1"></script>
<script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
<style media="screen">
#container {
width: 100%;
height: 600px;
}
</style>
</head>
<body>
<div id="container"></div>
<script>
var map = new AMap.Map('container', {
resizeEnable: true,
zoom: 11,
center: [116.397428, 39.90923]
});
</script>
</body>
</html>