| xqd
@@ -73,7 +73,6 @@ $(function() {
|
|
|
console.log('ok');
|
|
|
var lat = position.coords.latitude;
|
|
|
var lng = position.coords.longitude;
|
|
|
- console.log(lat, lng);
|
|
|
//调用地图命名空间中的转换接口 type的可选值为 1:GPS经纬度,2:搜狗经纬度,3:百度经纬度,4:mapbar经纬度,5:google经纬度,6:搜狗墨卡托
|
|
|
qq.maps.convertor.translate(new qq.maps.LatLng(lat, lng), 1, function(res){
|
|
|
//取出经纬度并且赋值
|
| xqd
@@ -89,9 +88,10 @@ $(function() {
|
|
|
position : latlng
|
|
|
});
|
|
|
});
|
|
|
+ }, function (error) {
|
|
|
+ console.log('no');
|
|
|
});
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
alert('浏览器不支持定位')
|
|
|
}
|
|
|
});
|