-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";
}
} });
由於它的工作原理。我以爲我已經嘗試過,但我可能沒有。 –