三維線資料結構
三維線資料結構
線資料是一串點資料的陣列,由兩個以上的點位資訊依照順序排列連接而成的幾何圖形。就如同數學幾何的定義,線資料並沒有寬度,要在地圖上呈現和設定線圖徵的寬度(粗細),請參照圖層套疊大項下圖形與圖片類別中的設定線圖徵頁籤。利用線資料結構可以計算線段長度、判斷是否有自相交叉。
function drawline() {
var path = []; //設定path節點順序
path[0] = new TGOS.TEPoint(121.51861, 25.04193);
path[1] = new TGOS.TEPoint(121.51971, 25.04568);
path[2] = new TGOS.TEPoint(121.52232, 25.05112);
path[3] = new TGOS.TEPoint(121.52269, 25.05261);
path[4] = new TGOS.TEPoint(121.52309, 25.06109);
path[5] = new TGOS.TEPoint(121.52270, 25.06279);
path[6] = new TGOS.TEPoint(121.52239, 25.06425);
path[7] = new TGOS.TEPoint(121.52245, 25.06660);
path[8] = new TGOS.TEPoint(121.52297, 25.06840);
path[9] = new TGOS.TEPoint(121.53262, 25.06819);
var lineStr = new TGOS.TELineString(path); //設定線資料的path
var testline = new TGOS.TELine(tg3dEarth,lineStr,{
strokeColor: '#00FF00',
strokeWeight: 5,
strokeOpacity: 0.7
});
}