我无法从经度检索数据。静态它的工作原理,但如果我使用变量currentLatLng.longitutde
,我得到null
。 这是我的代码:从位置坐标获得经度
var currentLatLng = position.coords;
var latlon = "Latitude" + currentLatLng.latitude + ","
+ "Longitude" + currentLatLng.longitutde;
var mappOptions = {
center: new google.maps.LatLng(currentLatLng.latitude,
currentLatLng.longitutde),
//center: new google.maps.LatLng(currentLatLng.latitude, 10.181531600000001),
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var DirectionsService = new google.maps.DirectionsService;
var directionsDisplay = new google.maps.DirectionsRenderer;
var geocoder = new google.maps.Geocoder;
var map = new google.maps.Map(document.getElementById("map"), mappOptions);
directionsDisplay.setMap(map);
感谢兄弟......是的,我没有看到,我 –
看出你是在SO新用户。当答案解决您的问题时,请将其标记为已接受。谢谢。 – imerso