<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Title> lianxi </title>
</Head>
<Body onload = "Init ();">
<Object ID = "teinformationwindow" classid = "CLSID: 3a4f9193-65a8-11d5-85c1-0001023952c1" width = "300" Height = "400">
<Embed width = "300" Height = "400"> </embed>
</Object>
<Object ID = "te3dwindow" classid = "CLSID: 3a4f9192-65a8-11d5-85c1-0001023952c1" width = 650 Height = "400"> </Object>
<Object ID = "te" classid = "CLSID: 3a4f9191-65a8-11d5-85c1-0001023952c1"> </Object>
<HR/>
<Br>
<Table width = "100%" Height = "133" border = "1" align = "center" bordercolor = "#00ff33">
<Tr>
<TD width = "16%" Height = "29" align = "center">
<Input type = "button" name = "createline" value = "create line" onclick = "createpolyline ()">
<Input type = "button" name = "Container" value = "pop-up window" onclick = "container ()">
</TD>
& Lt; TD width = "16%" align = "center" & gt;
<Input type = "button" name = "iterraexplorer" value = "Pro attribute" onclick = "proinfo ()">
<Input type = "button" name = "iterraexplorer" value = "Pro method" onclick = "methedinfo ()">
</TD>
& Lt; TD width = "16%" align = "center" & gt;
<Input type = "button" name = "typeinfo" value = "iterrain property test" onclick = "iterrainproinfo ()">
</TD>
<TD colspan = "3" align = "center"> & nbsp;
<Input type = "button" name = "typeinfo" value = "attributes of istartposition" onclick = "iistartpositioninfo ()">
<Input type = "button" name = "typeinfo" value = "irender attributes" onclick = "irenderproinfo ()">
<Input type = "button" name = "addprograme" value = "add project file" onclick = "addg ()">
</TD>
</Tr>
<Tr>
<TD Height = "25" colspan = "2"> <label> path creation operation: </label>
<Input type = "button" name = "createdynamic" value = "CREATE" onclick = "createdynamic ()">
<Input type = "button" name = "dynamicplay" value = "play" onclick = "dynamicplay ()">
<Input type = "button" name = "dynamicstop" value = "stop" onclick = "dynamicstop ()">
<Input type = "button" name = "dynamicp" value = "Suspend" onclick = "dynamicp ()"> </TD>
<TD colspan = "2" align = "center"> & nbsp;
<Input type = "text" name = "text" value = "new group" id = "CG" width = "120">
<Input type = "button" name = "creategroup" value = "" id = "gn" onclick = "creategroup1 ()"> </TD>
& Lt; TD width = "15%" align = "center" & gt;
<Input type = "button" name = "kuaizhao" value = "snapshot" onclick = "menu. Invoke (32783)">
<Input type = "button" name = "kzsaveas" value = "Mouse mode" onclick = "getmousemode ()">
</TD>
<TD width = "20%" type = "codeph" text = "codeph"> & nbsp;
<Input type = "checkbox" name = "showlaler" Checked id = "CHK1" onclick = "layervis ()"> <label> display and hide layers </label>
</TD>
</Tr>
<Tr>
<TD Height = "21" colspan = "4">
Name: <input name = "name" id = "flyname" type = "text" value = "Karamay" size = "12" width = "100">
Longitude: <input name = "flyjd" id = "flyjd" type = "text" value = "87" size = "10" width = "100">
Latitude: <input name = "flywd" id = "flywd" type = "text" value = "43" size = "10" width = "100">
& Nbsp;
<Input type = "button" value = "" name = "flytosomewhere" onclick = "flytosomewhere ()">
</TD>
<TD> <input type = "button" name = "deleteobj" value = "delete selected object" id = "delobj" onclick = "delobj ()"> </TD>
<TD align = "center"> <input type = "button" name = "infortree" id = "iftv" value = "information tree traversal" onclick = "informationtreevist () "> </TD>
</Tr>
<Tr>
<TD Height = "19"> <input type = "button" name = "createpolygon" value = "create pyramid" onclick = "createp ()"> </TD>
<TD> & nbsp; </TD>
<TD> & nbsp; </TD>
<TD width = "17%"> & nbsp; </TD>
<TD> & nbsp; </TD>
<TD> <input type = "button" name = "loadsave" value = "load my operations" onclick = "loadfromsaved ()"> </TD>
</Tr>
<Tr>
<TD Height = "25" colspan = "3"> longitude: <span id = "JD"> </span> latitude: <span id = "WD"> </span> </TD>
<TD colspan = "3"> & nbsp; <input type = "button" value = "save" name = "save" onclick = "saveas ()"> & nbsp;
<Input type = "file" value = "E: \ A. Fly" name = "saveas" id = "ADR" width = "10"> & nbsp;
<Input type = "button" value = "Fly save as" name = "save" onclick = "saveasother ()">
<Label> </label>
</TD>
</Tr>
</Table>
</Body>
<Script language = "JavaScript">
VaR iterraexplorer = NULL;
VaR iinformationtree = NULL;
VaR polylineflag = false;
VaR dynamicflag = false;
VaR irender = NULL;
VaR ipolympus = "";
VaR isline = false;
VaR isroute = false;
VaR iobiectmanager = NULL;
VaR istartposition = NULL;
VaR route = "";
VaR icontainer = NULL;
VaR iplane = NULL;
VaR iterrain = NULL;
VaR istartposition = NULL;
VaR iterrain = NULL;
VaR menu = NULL;
VaR isnapshot = NULL;
VaR Itemid = "";
VaR curitemid = "";
VaR groupid = "";
VaR createpolygoyflag = false;
VaR ispolygon = false;
VaR ipolympus Gon = "";
Function Init ()
{
Iterraexplorer = tE. Interface ("iterraexplorer5 ");
Iinformationtree = tE. Interface ("iinformationtree5 ");
Irender = tE. Interface ("irender5 ");
Iobjectmanager = tE. Interface ("iobjectmanager5 ");
Istartposition = tE. Interface ("istartposition ");
Icontainer = tE. Interface ("icontainer2 ");
Iplane = tE. Interface ("iplane5 ");
Iterrain = tE. Interface ("iterrain4 ");
Istartposition = tE. Interface ("istartposition ");
Irender = tE. Interface ("irender5 ");
Menu = tE. Interface ("imenu ");
Isnapshot = tE. Interface ("isnapshot2 ");
Iterraexplorer. Load ("C: \ A. Fly ");
Window. setTimeout ("test ()", 800 );
}
Function Test ()
{
Iinformationtree. loadflylayerex ("[Te application data] \ My last operation record. Fly", 0 );
Iinformationtree. loadflylayerex ("[Te application data] \ My last created dynamic path. Fly", 0 );
}
Function saveas ()
{
Iterraexplorer. Save ();
Alert ("saved successfully ");
}
Function saveasother ()
{
VaR TXT = Document. getelementbyid ("ADR"). value;
If (txt! = "")
{
Iterraexplorer. saveas (txt );
Alert ("saved successfully ");
}
Else
Alert ("Enter the location to store! ");
}
Function createpolyline ()
{
Polylineflag = true;
Irender. setmouseinputmode (1 );
}
Function createdynamic ()
{
Dynamicflag = true;
Irender. setmouseinputmode (1 );
}
Function te: onlbuttondown (flag, X, Y, handled)
{
If (polylineflag)
Createpolylinevb (x, y );
If (dynamicflag)
Createdynamicvb (x, y );
If (createpolygoyflag)
Createpolygonvb (x, y)
}
Function te: onrbuttondown (flag, X, Y, handled)
{
Polylineflag = false;
Dynamicflag = false;
Isline = false;
Isroute = false;
Irender. setmouseinputmode (0 );
Curitemid = "";
Createpolygoyflag = false;
}
Function container ()
{
// Welcome to use this product !! You can also use the URL to locate
Icontainer. htmlpopup (0, 50, 50, 350,350, "container window", "welcome to use this product !! ", 2,-1 );
}
Function proinfo ()
{
Alert (iterraexplorer. type );
Alert (iterraexplorer. flyname );
Alert (iterraexplorer. displayerrormessages = 1 );
}
Function methedinfo ()
{
Alert (iterraexplorer. getuserunits (0, 3, 5, 7 ));
Alert (iterraexplorer. getteversion ("5", "00", "38 "));
}
Function iterrainproinfo ()
{
Alert ("MPT file name:" + iterrain. mptname );
Alert ("File Name of systemkey:" + iterrain. systemkey );
Alert ("groupkey file name:" + iterrain. groupkey );
Alert ("datumkey file name:" + iterrain. datumkey );
Alert ("unitkey file name:" + iterrain. unitkey );
Alert ("epsg file name:" + iterrain. epsg );
Alert ("description file name:" + iterrain. Description );
}
Function iistartpositioninfo ()
{
Alert ("START coordinate X" + istartposition. startx );
Alert ("START coordinate z" + istartposition. startz );
}
Function irenderproinfo ()
{
Alert (irender. hudmode = 6 );
}
Function creategroup1 ()
{
VaR groupid = NULL;
VaR groupname = Document. getelementbyid ("CG"). value;
If (groupname! = "")
Groupid = iinformationtree. creategroup (groupname, 0 );
Else
Alert ("enter the name of the group to be created! ");
}
Function te: oninfotreeaction (Itemid, action, actionparam)
{
Curitemid = Itemid;
}
Function addg ()
{
Iinformationtree. loadflylayer ("E: \ skyline \ Terra pro exercise \ lianxi \ 124.fly ");
Alert ("project added successfully! ");
}
Function layervis ()
{
If (document. getelementbyid ("CHK1"). Checked)
Iinformationtree. setgroupvisibility (iinformationtree. finditem ("0"), true );
Else
Iinformationtree. setgroupvisibility (iinformationtree. finditem ("0"), false );
}
Function flytosomewhere ()
{
VaR tname, tx0, tz0
Tname = Document. getelementbyid ("flyname"). value;
Tx0 = Document. getelementbyid ("flyjd"). value;
Tz0 = Document. getelementbyid ("flywd"). value;
Createlabelflyto (tname, tx0, tz0 );
}
Function createlabelflyto (txt, X1, Z1)
{
VaR labelinfo = new object ();
Labelinfo. Text = txt;
Labelinfo. Scale = 1;
Labelinfo. bgcolor = 0xff00;
Iobjectmanager. createlabel (labelinfo, X1, Z1, 2000.0 );
Iplane. flyto (x1, Z1, 2000.0, 117.98, 0,-35, "Oval ");
}
Function delobj ()
{
If (curitemid = "")
{
Alert ("select the object you want to delete! ");
}
Else
{
Iinformationtree. deleteitem (curitemid );
Alert ("deleted successfully! ");
Curitemid = "";
}
}
Function informationtreevist ()
{
VaR groupid = iinformationtree. getnextitem (0, 11 );
If (groupid = 0)
{
Alert ("no object in the information tree! ");
Return 0;
}
Else
Informationtreeall (groupid );
}
Function informationtreeall (groupid)
{
VaR A, B, C;
If (groupid = 0)
Return 0;
Else
{
B = confirm (iinformationtree. getitemname (groupid) + "_ ID:" + groupid );
If (B = false)
{
Return 0;
}
A = groupid;
Groupid = iinformationtree. getnextitem (groupid, 11 );
If (groupid = 0)
{
Groupid = iinformationtree. getnextitem (A, 13 );
If (groupid = 0)
{
Groupid = iinformationtree. getnextitem (A, 15 );
C = groupid;
Groupid = iinformationtree. getnextitem (C, 13); groupid
While (groupid = 0)
{
Groupid = iinformationtree. getnextitem (C, 15 );
Groupid = iinformationtree. getnextitem (groupid, 13 );
If (groupid = 0)
Return 0;
}
}
}
Informationtreeall (groupid );
}
}
Function loadfromsaved ()
{
Alert (iinformationtree. loadflylayerex ("[Te application data] \ e. Fly", 0 ));
}
/* Function createp ()
{
Createpflag = true;
Iobjectmanage. createpyramid (X, Y ,);
}*/
</SCRIPT>
<Script language = "VBScript">
Function createpolylinevb (x, y)
Dim outx, outy, outh, objectid
Irender. screentoworld X, Y, 63, outx, outh, outy, objectid
If curitemid <> "then
If iinformationtree. isgroup (curitemid) then
If isline = false then
Isline = true
Set ipolympus line = iobjectmanager. createpolyline (, 2, curitemid, "")
Else
Ipolympus line. addvertex outx, outh, outy, 0
End if
Iinformationtree. saveflylayer "my previous operation records. Fly", curitemid
Else
Msgbox "you select an object that cannot accommodate objects. Select a group! "
End if
Else
Msgbox "select a group that contains objects! "
End if
End Function
Function createdynamicvb (x, y)
Irender. screentoworld X, Y, 63, outx, outh, outy, objectid
If curitemid <> "then
If iinformationtree. isgroup (curitemid) then
If isroute = false then
Set route = iobjectmanager. createroute (empty, 0, curitemid, "Dynamic Path ")
Isroute = true
Else
Route. addwaypoint outx, outh, outy, 0,-45, 0,-45, 0, 100 ,""
End if
Iinformationtree. saveflylayer "My last created dynamic path. Fly", curitemid
Else
Msgbox "you select an object that cannot accommodate objects. Select a group! "
End if
Else
Msgbox "select a group that contains objects! "
End if
End Function
Function dynamicplay ()
Route. Play
Msgbox "playback dynamic path"
End Function
Function dynamicp ()
Route. Pause
Msgbox "Pause playing dynamic path"
End Function
Function getmousemode ()
Msgbox irender. getmouseinputmode
End Function
Function te_onframe ()
Dim X1, Y1
Irender. getmouseinfo 1, X1, Y1
Objtype = 0
Irender. screentoworld X1, Y1, objtype, worldx, worldheigth, worldy, objectid
Document. getelementbyid ("JD"). innerhtml = worldx
Document. getelementbyid ("WD"). innerhtml = worldy
End Function
</SCRIPT>
</Html>