Ox1.js自带的位置接口,获取经度:pos.coords.longitude,获取纬度:pos.coords.latitude
navigator.geolocation.getCurrentPosition(function(pos){ var posX=pos.coords.longitude,posY=pos.coords.latitude; //高德api代码段放在此处 })
0x2.初始化地图
var map = new AMap.Map('容器id', { resizeEnable: true, zoom:11, center: [posX, posY] });