1.首先引入申请的key
<script type="text/javascript"src="https://webapi.amap.com/maps?v=1.4.12&key=您申请的ke值&plugin=Map2D,ElasticMarker,AMap.DistrictLayer&callback=inint"></script>
其中plugin=ElasticMarker需要单独配置,一般需要用到的时候需要在这里添加此配置
2.map的配置
var map = new AMap.Map('container_map', {
// layers:[layer] ,
viewMode:'2D',
zooms:[8,20],
showLabel:true,
features:['bg','point','road'],
// mapStyle:'amap://styles/blue',
lang:'zh_cn', //设置地图语言类型
});
map.setCity('320000') // 设置焦点区域
map.setFitView();