//html5自带了获得当前坐标的方法
function getLocation(){
if(navigator.geolocation){
//获得当前定位 enableHighAccuracy:true设置高精度
navigator.geolocation.getCurrentPosition(showPosition,showError,{enableHighAccuracy:true,timeout:10000});}else{
alert("浏览器不支持地理定位");
}
}
//
function showPosition(position){
//html5中设置地图高度和宽度
var map_h=parseInt(4*deviceWidth/7.2);var map_w=deviceWidth;
//alert(typeof deviceWidth);
var addre=document.getElementById("addre");
//这里是获得lat纬度 lag精度
var lat = position.coords.latitude;va