function initialize() {
var mapProp = { center:new google.maps.LatLng(5,-5), zoom:5, mapTypeId:google.maps.MapTypeId.ROADMAP };
var map=new google.maps.Map(document.getElementById("mapContainer"),mapProp);
}
google.maps.event.addDomListener(window, 'load', initialize);
我想获得当前的纬度和经度
答案 0 :(得分:0)
您可以使用以下代码
if (navigator.geolocation){
navigator.geolocation.getCurrentPosition(callBackFunc);
}
function callBackFunc(position){
var _lat = position.coords.latitude;
var _lon = position.coords.longitude;
}