1、基础配置
JSAPI 教程:https://lbs.amap.com/api/javascript-api/summary
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>map</title>
<style>
html, body, #container {
margin: 0; padding: 0; width: 100%; height: 100%;
}
</style>
</head>
<body>
<div id="container" class="container"></div>
<script src="https://webapi.amap.com/maps?v=1.4.15&key=您申请的key值"></script>
<script>
var map = new AMap.Map('container', {
resizeEnable: true, //是否监控地图容器尺寸变化
zoom:11, //初始化地图层级
center: [108.970,34.225] //初始化地图中心点
});
</script>
</body>
</html>
2、定位
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>map</title>
<style>
html, body, #container {
ma