Beginner in the Second Development of Skyline software-11 how to load and save project files on 3D maps on Web pages

Source: Internet
Author: User

1. Save:

 

<HTML>
<Head>
<Title> saving </title>
<Object ID = "sgworld" classid = "CLSID: 3a4f91b1-65a8-11d5-85c1-0001023952c1" style = "visibility: hidden; Height: 0"> </Object>
<SCRIPT type = "text/JavaScript">

Function Init ()
{
VaR group = createpolygons ();

Alert ("Click OK to save the polygons ");

// This can be done on any group node.
Try
{
VaR ret = sgworld. projecttree. saveasfly ("mywork. Fly", group );
Alert ("the polygons were successfully saved to:" + RET );
}
Catch (E)
{
Alert ("error: the polygons were not saved \ r \ ndescription:" + E. Description );
}
}



Function createpolygons ()
{
VaR group = sgworld. projecttree. creategroup ("polygons ");
VaR pointsusuah = sgworld. creator. geometrycreator. creategeometryfromwkt ("polygon (-114.03822 41.99547,-111.04795 41.99626,-111.05028 40.99663,-109.04763 40.99847 109.04782,-36.99664 114.04313 ))");

// 2 in altitudetypecode means on terrain, 0 means add to root
VaR polyutah = sgworld. creator. createpolygon (pointsuah, "# ff0000", sgworld. creator. createcolor (0,255,255, 40), 2, group, "Utah ");//

Polyutah. linestyle. width = 5000; // 5000 m (5 km)

VaR pointswyoming = sgworld. creator. geometrycreator. creategeometryfromwkt ("polygon (-111.05265 44.99576,-104.05934 44.99734,-104.05120 41.00322,-111.05028 40.99663,-111.05265 44.99576 ))");

// 2 in altitudetypecode means on terrain, 0 means add to root
VaR polywyoming = sgworld. creator. createpolygon (pointswyoming, sgworld. creator. createcolor (255,255, 0, 10), null, 2, group, "Wyoming ");

Polywyoming. linestyle. width = 20000; // 20000 m (20 km)

Polywyoming. position. Distance = 1600000;
Sgworld. Navigate. flyto (polywyoming );
Return group;
}

</SCRIPT>
</Head>
<Body onload = "Init ();">
</Body>
</Html>

 

2. Load:

 

<HTML>
<Head>
<Title> loading </title>
<Object ID = "sgworld" classid = "CLSID: 3a4f91b1-65a8-11d5-85c1-0001023952c1" style = "visibility: hidden; Height: 0"> </Object>
<SCRIPT type = "text/JavaScript">

Function Init ()
{
Alert ("Click OK to load the polygons ");
VaR id = sgworld. projecttree. loadflylayer (sgworld. application. datapath + "\ mywork. Fly ");
Sgworld. Navigate. flyto (sgworld. creator. createposition (-109.51449, 32.85615, 1500000, 0,-60 ));
}

</SCRIPT>
</Head>
<Body onload = "Init ();">
</Body>
</Html>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.