日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Skyline软件二次开发初级——8如何在WEB页面中的三维地图上管理信息树

發布時間:2023/12/14 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Skyline软件二次开发初级——8如何在WEB页面中的三维地图上管理信息树 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.創建組:

<html>
????<head>
????????<title>Node?1</title>
????????<object?id="SGWorld"?classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1"?style="visibility:hidden;height:0?"></object>
????????<script?type="text/javascript">
????????
????????
var?popup?=?null;
????????
????????
function?Init()
????????{
????????????
var?NewEngland????=?SGWorld.ProjectTree.CreateGroup("New?England");
????????????
var?Vermont?=???????SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-72.75206,?43.91127,?0,0,?0.0,?0,?-85,?800000.0),?"Vermont",?SGWorld.Creator.CreateLabelStyle(),?NewEngland???????,?"Vermont"?);
????????????
var?Maine?=?????????SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-69.40414,?45.12594,?0,0,?0.0,?0,?-85,?800000.0),?"Maine",?SGWorld.Creator.CreateLabelStyle(),?NewEngland?????????,?"Maine"??);
????????????
var?Massachusetts?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-71.88455,?42.34216,?0,0,?0.0,?0,?-85,?800000.0),?"Massachusetts",?SGWorld.Creator.CreateLabelStyle(),?NewEngland?,?"Massachusetts"?);
????????????
var?RhodeIsland?=???SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-71.57073,?41.62953,?0,0,?0.0,?0,?-85,?800000.0),?"Rhode?Island",?SGWorld.Creator.CreateLabelStyle(),?NewEngland??,?"Rhode?Island"?);
????????????
var?Connecticut?=???SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-72.64295,?41.57912,?0,0,?0.0,?0,?-85,?800000.0),?"Connecticut",?SGWorld.Creator.CreateLabelStyle(),?NewEngland???,?"Connecticut"??);


????????????SGWorld.Navigate.FlyTo(Vermont);
????????????
????????????
????????????
//?Display?a?message?to?the?user
????????????popup?=?SGWorld.Creator.CreatePopupMessage("Nodes?hierarchy?sample");
????????????popup.InnerText?
=?"This?sample?shows?how?to?group?several?nodes?-?locations?in?this?case,\n"?+
??????????????????????????????
"and?add?them?to?the?SkylineGlobe?nodes?hierarchy.";
????????????popup.Align?
=?"TopLeft";
????????????SGWorld.Window.ShowPopup(popup);??
????????????
????????}
????????
????????
function?Uninit()
????????{
????????????
if(SGWorld.Project.Name?==?"")
????????????????
return;
????????????SGWorld.ProjectTree.DeleteItem(SGWorld.ProjectTree.FindItem(
"New?England"));
????????????
if(popup)
????????????????SGWorld.Window.RemovePopup(popup);

????????}
????????
????????
</script>
????</head>
????<body?onload="Init();"?onunload="Uninit()">
????</body>
</html>

2.對象數據:

<html>
????<head>
????????<title>Node?2</title>
????????<object?id="SGWorld"?classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1"?style="visibility:hidden;height:0?"></object>
????????<script?type="text/javascript">
????????
????????var?popup?=?null;
????????
????????function?Init()
????????{

????????????var?NewEngland?=?SGWorld.ProjectTree.CreateGroup("New?England");
????????????var?Vermont?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-72.75206,?43.91127,?0,?0,?0.0,?0,?-85,?800000.0),?"Vermont",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Vermont");
????????????var?Maine?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-69.40414,?45.12594,?0,?0,?0.0,?0,?-85,?800000.0),?"Maine",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Maine");
????????????var?Massachusetts?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-71.88455,?42.34216,?0,?0,?0.0,?0,?-85,?800000.0),?"Massachusetts",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Massachusetts");
????????????var?RhodeIsland?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-71.57073,?41.62953,?0,?0,?0.0,?0,?-85,?800000.0),?"Rhode?Island",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Rhode?Island");
????????????var?Connecticut?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-72.64295,?41.57912,?0,?0,?0.0,?0,?-85,?800000.0),?"Connecticut",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Connecticut");

????????????SGWorld.Navigate.FlyTo(Vermont);
????????????
????????????//?setting?attributes?to?the?nodes

????????????Vermont.ClientData("population")?=?562758;
????????????Maine.ClientData("population")?=?1227928;
????????????Massachusetts.ClientData("population")?=?6016425;
????????????RhodeIsland.ClientData("population")?=?1003464;
????????????Connecticut.ClientData("population")?=?3287116;

????????????var?newEnglandPopulation?=
????????????????????????????????parseInt(Vermont.ClientData("population"))?+
????????????????????????????????parseInt(Maine.ClientData("population"))?+
????????????????????????????????parseInt(Massachusetts.ClientData("population"))?+
????????????????????????????????parseInt(RhodeIsland.ClientData("population"))?+
????????????????????????????????parseInt(Connecticut.ClientData("population"));
????????????
????????????
????????????//?Display?a?message?to?the?user
????????????popup?=?SGWorld.Creator.CreatePopupMessage("Nodes?hierarchy?sample");
????????????popup.InnerHTML?=?"This?sample?shows?how?to?set?and?retrieve?attribute?information?to?a?object.<br><br>"?+
??????????????????????????????"The?total?population?of?<b>New?England</b>?in?1990?was:?"?+?newEnglandPopulation;
????????????popup.Align?=?"TopLeft";
????????????SGWorld.Window.ShowPopup(popup);??
????????????
????????}
????????
????????function?Uninit()
????????{
????????????if(SGWorld.Project.Name?==?"")
????????????????return;
????????????SGWorld.ProjectTree.DeleteItem(SGWorld.ProjectTree.FindItem("New?England"));
????????????if(popup)
????????????????SGWorld.Window.RemovePopup(popup);

????????}
????????
????????</script>
????</head>
????<body?οnlοad="Init();"?οnunlοad="Uninit()">
????</body>
</html>

?

3.遍歷對象:

?

<html>
????<head>
????????<title>Node?3</title>
????????<object?id="SGWorld"?classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1"?style="visibility:hidden;height:0?"></object>
????????<script?type="text/javascript">
????????
????????
var?popup?=?null;
????????
????????
function?Init()
????????{
????????????????????????
????????????
var?group?=?createNewEnglandNode();

????????????popup?
=?SGWorld.Creator.CreatePopupMessage("Nodes?hierarchy?sample","",0,0,400,200);
????????????popup.InnerHTML?
=?"This?sample?shows?how?to?traverse?the?node?hierarchy.<br><br>";

????????????
//?11?is?get?child
????????????var?node?=?SGWorld.ProjectTree.GetNextItem(group,?11);
????????????
while?(node?>?0)
????????????{
????????????????
var?object?=?SGWorld.ProjectTree.GetObject(node);
????????????????popup.innerHTML?
+=?"The?population?of?<b>"?+?object.TreeItem.Name?+?"</b>?is:?"?+?object.ClientData("population")?+?"<br>";
????????????????
//?13?is?get?next?sibling
????????????????node?=?SGWorld.ProjectTree.GetNextItem(node,?13);
????????????}
????????????
????????????popup.align?
=?"TopLeft";
????????????SGWorld.Window.ShowPopup(popup);??????????????
????????}
????????
????????
????????
????????
????????
????????
function?createNewEnglandNode()
????????{
????????????
var?NewEngland?=?SGWorld.ProjectTree.CreateGroup("New?England");
????????????
var?Vermont?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-72.75206,?43.91127,?0,?0,?0.0,?0,?-85,?800000.0),?"Vermont",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Vermont");
????????????
var?Maine?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-69.40414,?45.12594,?0,?0,?0.0,?0,?-85,?800000.0),?"Maine",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Maine");
????????????
var?Massachusetts?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-71.88455,?42.34216,?0,?0,?0.0,?0,?-85,?800000.0),?"Massachusetts",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Massachusetts");
????????????
var?RhodeIsland?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-71.57073,?41.62953,?0,?0,?0.0,?0,?-85,?800000.0),?"Rhode?Island",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Rhode?Island");
????????????
var?Connecticut?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-72.64295,?41.57912,?0,?0,?0.0,?0,?-85,?800000.0),?"Connecticut",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Connecticut");

????????????SGWorld.Navigate.FlyTo(Vermont);

????????????
//?setting?attributes?to?the?nodes

????????????Vermont.ClientData(
"population")?=?562758;
????????????Maine.ClientData(
"population")?=?1227928;
????????????Massachusetts.ClientData(
"population")?=?6016425;
????????????RhodeIsland.ClientData(
"population")?=?1003464;
????????????Connecticut.ClientData(
"population")?=?3287116;

????????????
return?NewEngland;
????????}
????????
????????
????????
function?Uninit()
????????{
????????????
if(SGWorld.Project.Name?==?"")
????????????????
return;
????????????SGWorld.ProjectTree.DeleteItem(SGWorld.ProjectTree.FindItem(
"New?England"));
????????????
if(popup)
????????????????SGWorld.Window.RemovePopup(popup);

????????}
????????
????????
</script>
????</head>
????<body?onload="Init();"?onunload="Uninit()">
????</body>
</html>

?

4.搜索樹節點:

?

<html>
????<head>
????????<title>Node?5</title>
????????<object?id="SGWorld"?classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1"?style="visibility:hidden;height:0?"></object>
????????<script?type="text/javascript">
????????
????????
var?popup?=?null;
????????
????????
function?Init()
????????{
????????????
//?Create?the?"New?England"?group?node?and?its??children
????????????var?NewEngland?=?createNewEnglandNode();
????????????
????????????popup?
=?SGWorld.Creator.CreatePopupMessage("Nodes?hierarchy?sample","",0,0,350,150);
????????????popup.InnerHTML?
=?"This?sample?shows?how?to?search?the?nodes?heirarchy?tree.<br><br>";
????????????popup.InnerHTML?
+=?"<b><u>Search?Results:</u></b><br>";
????
????????
????????????
var?RhodeIsland?=?SGWorld.ProjectTree.FindItem("\\New?England\\Rhode?Island");
????????????
if?(RhodeIsland?>?0)
????????????????popup.InnerHTML?
+=?"The?population?of?<b>Rhode?Island</b>?is:?"?+?SGWorld.ProjectTree.GetObject(RhodeIsland).ClientData("population")?+?"<br>";?
????????????
????????????popup.align?
=?"TopLeft";
????????????SGWorld.Window.ShowPopup(popup);??????????????
????????}





????????
function?createNewEnglandNode()
????????{
????????????
var?NewEngland?=?SGWorld.ProjectTree.CreateGroup("New?England");
????????????
var?Vermont?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-72.75206,?43.91127,?0,?0,?0.0,?0,?-85,?800000.0),?"Vermont",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Vermont");
????????????
var?Maine?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-69.40414,?45.12594,?0,?0,?0.0,?0,?-85,?800000.0),?"Maine",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Maine");
????????????
var?Massachusetts?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-71.88455,?42.34216,?0,?0,?0.0,?0,?-85,?800000.0),?"Massachusetts",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Massachusetts");
????????????
var?RhodeIsland?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-71.57073,?41.62953,?0,?0,?0.0,?0,?-85,?800000.0),?"Rhode?Island",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Rhode?Island");
????????????
var?Connecticut?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-72.64295,?41.57912,?0,?0,?0.0,?0,?-85,?800000.0),?"Connecticut",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Connecticut");

????????????SGWorld.Navigate.FlyTo(Vermont);

????????????
//?setting?attributes?to?the?nodes

????????????Vermont.ClientData(
"population")?=?562758;
????????????Maine.ClientData(
"population")?=?1227928;
????????????Massachusetts.ClientData(
"population")?=?6016425;
????????????RhodeIsland.ClientData(
"population")?=?1003464;
????????????Connecticut.ClientData(
"population")?=?3287116;

????????????
return?NewEngland;
????????}
????????
????????
????????
function?Uninit()
????????{
????????????
if(SGWorld.Project.Name?==?"")
????????????????
return;
????????????SGWorld.ProjectTree.DeleteItem(SGWorld.ProjectTree.FindItem(
"New?England"));
????????????
if(popup)
????????????????SGWorld.Window.RemovePopup(popup);

????????}
????????
????????
</script>
????</head>
????<body?onload="Init();"?onunload="Uninit()">
????</body>
</html>

?

5.刪除樹節點:

?

<html>
????<head>
????????<title>Node?7</title>
????????<object?id="SGWorld"?classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1"?style="visibility:hidden;height:0?"></object>
????????<script?type="text/javascript">

????????
var?popup?=?null;
????????
????????
function?Init()
????????{

????????????
//?Create?the?"New?England"?group?node?and?its??children
????????????var?NewEngland?=?createNewEnglandNode();


????????????popup?
=?SGWorld.Creator.CreatePopupMessage("Nodes?hierarchy?sample",?"",?0,?0,?350,?150);
????????????popup.InnerText?
=?"This?sample?shows?how?to?remove?(delete)?nodes.";????????????
????????????popup.Align?
=?"TopLeft";
????????????SGWorld.Window.ShowPopup(popup);
????????????setTimeout(DeleteObjects,?
100);

????????}

????????
function?DeleteObjects()
????????{
????????????alert(
"Click?OK?to?remove?Maine?and?Vermont?from?the?New?England?group");

????????????
var?nodeToDelete?=?SGWorld.ProjectTree.FindItem("\\New?England\\Maine");
????????????SGWorld.ProjectTree.DeleteItem(nodeToDelete);
????????????nodeToDelete?
=?SGWorld.ProjectTree.FindItem("\\New?England\\Vermont");
????????????SGWorld.ProjectTree.DeleteItem(nodeToDelete);????????????????????????????????
????????}

????????
function?createNewEnglandNode()
????????{
????????????
var?NewEngland?=?SGWorld.ProjectTree.CreateGroup("New?England");
????????????
var?Vermont?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-72.75206,?43.91127,?0,?0,?0.0,?0,?-85,?800000.0),?"Vermont",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Vermont");
????????????
var?Maine?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-69.40414,?45.12594,?0,?0,?0.0,?0,?-85,?800000.0),?"Maine",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Maine");
????????????
var?Massachusetts?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-71.88455,?42.34216,?0,?0,?0.0,?0,?-85,?800000.0),?"Massachusetts",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Massachusetts");
????????????
var?RhodeIsland?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-71.57073,?41.62953,?0,?0,?0.0,?0,?-85,?800000.0),?"Rhode?Island",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Rhode?Island");
????????????
var?Connecticut?=?SGWorld.Creator.CreateTextLabel(SGWorld.Creator.CreatePosition(-72.64295,?41.57912,?0,?0,?0.0,?0,?-85,?800000.0),?"Connecticut",?SGWorld.Creator.CreateLabelStyle(),?NewEngland,?"Connecticut");

????????????SGWorld.Navigate.FlyTo(Vermont);

????????????
//?setting?attributes?to?the?nodes

????????????Vermont.ClientData(
"population")?=?562758;
????????????Maine.ClientData(
"population")?=?1227928;
????????????Massachusetts.ClientData(
"population")?=?6016425;
????????????RhodeIsland.ClientData(
"population")?=?1003464;
????????????Connecticut.ClientData(
"population")?=?3287116;

????????????
return?NewEngland;
????????}


????????
function?Uninit()
????????{
????????????
if(SGWorld.Project.Name?==?"")
????????????????
return;
????????????SGWorld.ProjectTree.DeleteItem(SGWorld.ProjectTree.FindItem(
"New?England"));
????????????
if(popup)
????????????????SGWorld.Window.RemovePopup(popup);

????????}
????????
????????
</script>
????</head>
????<body?onload="Init();"?onunload="Uninit()">
????</body>
</html>

?

轉載于:https://www.cnblogs.com/yitianhe/archive/2012/09/24/2699672.html

總結

以上是生活随笔為你收集整理的Skyline软件二次开发初级——8如何在WEB页面中的三维地图上管理信息树的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。