/*
百度地图定位,应该是根据ip定位的吧
* */
var positionType=null;
function getLocation(){ saveUinfos('city','province','area',0,0);
var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function(r){
if(this.getStatus() == BMAP_STATUS_SUCCESS){
//alert('您的位置:'+r.point.lng+','+r.point.lat+" "+r.address.province+" "+r.address.district);
}
else {
alert('定位失败');
history.go(-1);
}
},{enableHighAccuracy: true});
百度地图定位,应该是根据ip定位的吧
* */
var positionType=null;
function getLocation(){ saveUinfos('city','province','area',0,0);
var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function(r){
if(this.getStatus() == BMAP_STATUS_SUCCESS){
//alert('您的位置:'+r.point.lng+','+r.point.lat+" "+r.address.province+" "+r.address.district);
}
else {
alert('定位失败');
history.go(-1);
}
},{enableHighAccuracy: true});
}
经纬度没有h5定位准确,但是h5定位不支持ios手机和电脑
注意:需要引入
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=m9OCmiQj80nR17gYi4fSeEhf"></script>