<< Click to Display Table of Contents >> Navigation: 3D API 說明範例 > 功能 > 路徑導覽 > 設定飛行路徑 |
<說明>
在本範例中,我們將示範如何設定飛行路徑,說明如下:
<範例>
function documentLoad() { SuperGIS.Initialize("/ServerGate/", function () { SuperGIS.ServerEarth.Initialize(InitEarth); }); }
function InitEarth() { var pBody = new SuperGIS.Windows.HTMLContainer(document.body);
var sHost = location.href; var idx = sHost.indexOf("/", 8); if (idx >= 0) sHost = sHost.substring(0, idx); CreateHTML5Earth(pBody, function (pEarth) { EarthLoaded(pEarth); });
function EarthLoaded(pEarth) { pEarth.Scene.BackgroundColor = pEarth.CreateColor(0, 0, 0, 1); pEarth.SetupSystem(true, s_WGS84); pEarth.SetupSkin(pEarth.CreateEnvelope(-180, 180, -90, 90, s_WGS84), sHost + "/ServerGate/Skin1.jpg");
var viewRoute = new SuperGIS.TEViewRoute();
//使用水平環繞地標導覽方法 viewRoute.horizontalFly(pEarth, { target: new SuperGIS.TEPoint(121.573860, 25.083811), //指定觀察地標 radius: 5000, //設定環繞半徑 height: 5000, //設定飛行高度 speed: 3000 //設定飛行速度 });
//使用垂直環繞地標導覽方法 //viewRoute.verticalFly(pEarth, { // target: new SuperGIS.TEPoint(121.573860, 25.083811), //指定觀察地標 // radius: 5000, //設定環繞半徑 // speed: 3000 //設定飛行速度 //});
//使用特定路徑觀察地標飛行方法 //viewRoute.sideFly(pEarth, { // target: new SuperGIS.TEPoint(121.573860, 25.083811), //指定觀察地標 // path: [new SuperGIS.TEPointZ(121.539614, 25.139729, 5000), // new SuperGIS.TEPointZ(121.613085, 25.101183, 5000), // new SuperGIS.TEPointZ(121.645014, 25.048786, 5000), // new SuperGIS.TEPointZ(121.619436, 25.114396, 5000)], //指定飛行路徑 // speed: 500 //設定飛行速度 //});
//使用特定路徑飛行導覽方法 //viewRoute.routeFly(pEarth, { // path: [new SuperGIS.TEPoint(121.539614, 25.139729), // new SuperGIS.TEPoint(121.613085, 25.101183), // new SuperGIS.TEPoint(121.645014, 25.048786), // new SuperGIS.TEPoint(121.619436, 25.114396)], //指定飛行路徑 // speed: 5000, //設定飛行速度 // dip: 70, //設定導覽時視點傾角 // height: 100 //設定飛行高度 //}); } }
|
© 2017 Supergeo Technologies Inc.