-1
我尝试获取地图上某个点的高程,但googlemaps的API提出的海拔函数不起作用,我不知道为什么。 看来,程序甚至没有通过该功能。获得Google地图标记的海拔
这里我的功能:
var elevationService = new google.maps.ElevationService();
var requestElevation = {
'locations': gmarkers[0].getPosition()};
elevationService.getElevationForLocations(requestElevation, function(results, status) {
if (status == google.maps.ElevationStatus.OK) {
if (results[0]) {
document.getElementById('denivele_circuit').value = parseFloat(results[0].elevation.toFixed(1)) + "mètres";
}
} });
由于它的工作原理。我以为我已经尝试过,但我可能没有。 –