線段沿線高程
線段沿線高程
此功能提供自訂線段,並設定分段點數量,取回各分段點之高程值陣列。
function ElevationPathClick(){
var txtDiv = document.getElementById("msg");
txtDiv.innerHTML = "";
var ele = newTGOS.TEElevation();
var path = [];
path[0] = newTGOS.TEPoint(121.176838,24.358669);
path[1] = newTGOS.TEPoint(121.688756,25.110529);
var lineStr = newTGOS.TELineString(path);
var testline = newTGOS.TELine(tg3dEarth,lineStr,{
strokeColor: '#00FF00',
strokeWeight: 5,
strokeOpacity: 0.7
});
var request = {
path:[newTGOS.TEPoint(121.176838,24.358669),newTGOS.TEPoint(121.688756,25.110529)],
samples: parseFloat(document.getElementById("sample").value)
};
ele.pathElevation(request,function(results){
for(var i = 0 ; i < results.length;i++) {
txtDiv.innerHTML += "["+ i + "]" + results[i].elevation + "<br>";
}
});
}