Skyline6用来BS开发文档格式.docx
- 文档编号:8298985
- 上传时间:2023-05-10
- 格式:DOCX
- 页数:79
- 大小:136.31KB
Skyline6用来BS开发文档格式.docx
《Skyline6用来BS开发文档格式.docx》由会员分享,可在线阅读,更多相关《Skyline6用来BS开发文档格式.docx(79页珍藏版)》请在冰点文库上搜索。
3a4f9191-65a8-11d5-85c1-0001023952c1"
returnTEObj;
}
functiontest(){
varTE=CreateTE();
varIInformationTree=TE.interface("
IInformationTree5"
varIPlane=TE.interface("
IPlane5"
IPlane.SetPosition(mypos.x,mypos.y,mypos.h,mypos.yaw,-90,mypos.roll,0,0,0);
八、
九、很多用过skylinesoft的人觉得:
用skyline做二次开发确实很简单。
二,如何解决调试WEB页面时自动运行TERRAEXPLORER软件的问题
大家在使用TerraExplorerDeveloper开发包进行二次开发的时候,特别是进行WEB开发的时候,经常会遇到这样一个问题,就是在WEB页面(html、aspx或者jsp等)中嵌入TerraExplorerObject对象,即
TE"
>
,
然后运行该WEB页面,在页面加载的过程中,会将TerraExplorerView或者TerraExplorerPro软件运行起来,
一般情况下,只要在当前页面中添加另外一个用于三维场景显示的控件
TerraExplorer3DWindow"
width=500height=400>
并且需要保证TerraExplorer3DWindow对象先于TE对象被初始化,即可消除前面提到的问题。
但在有些时候,我们开发的系统中可能会嵌入许多WEB页面,而且在这些页面中也都会涉及到对TE接口的调用,这时运行我们的系统,也有可能把TerraExplorer软件运行起来,这是我们不想看到的,其实也可以说这就是一种逻辑错误,而消除这个错误的方法很简单,就是我们必须保证所有对TE接口的调用,都要放在TerraExplorer3DWindow对象加载之后。
但是我们如何保证在复杂的系统中,理清他们之间的先后顺序呢?
这里可以给大家介绍一个实用的解决方法。
就是把TE对象放到一个函数里面去初始化,而不是像原来那样直接嵌在页面里。
例如:
function_$SGCreateTEObj()
{
varobj=window.document.getElementById("
if(obj==null)
obj=document.createElement('
object'
document.body.appendChild(obj);
obj.name="
obj.id="
obj.classid="
}
returnobj;
这样,在其他需要调用TE接口的时候,我们只需要重新实例化一下TE对象即可。
varTE=_$SGCreateTEObj();
varIPlane=TE.interface("
这时,大家也许还会有疑问,就是对于TE里面的事件接口_ITerraExplorerEvents5该如何引用呢?
在以前Skyline提供给大家的例子中,我们可以看到用javascript中的写法是
functionTE:
:
OnLoadFinished()
或者用vbscript的写法是
subTE_OnLoadFinished()
endsub
如果说对于TE的事件接口只能用上述固定的方式来实现的话,那么就又回到了最开始的状态,封装TE函数也就没有什么实际意义了。
其实在TE的ITerraExplorer51接口中,我们发现有AttachEvent和DetachEvent两个方法,这样就可以做到我们在需要调用TE的事件接口时Attach,不需要的时候Detach:
function_$SGCreateEvent()
varTE=_$SGCreateTEObj();
varITerraExplorer=TE.interface("
ITerraExplorer51"
ITerraExplorer.AttachEvent("
OnLButtonDown"
_$SGEventOnLButtonDown);
}
function_$SGDelEvent()
ITerraExplorer.DetachEvent("
如此,我们就可以更加灵活地使用TE的事件接口。
希望上述文字能够给大家提供一些帮助或者启发,感谢大家对Skyline的支持。
三,共享一些可以通过网络访问的MPT地址
skylinesoft官网上的:
skylineglobe.tbp@
bhuvan.tbp@bhuvan1.nrsc.gov.in
(印度的)
Macau_v2.mpt@62.28.57.114
mine3D.mpt@tg.geoid.be
四,基于Skyline的TEP5.1.3实现对矢量SHP文件的加载和渲染
我们知道在Skyline的TEP软件中可以添加多种矢量图层,对于常见的SHP文件,我们如何通过接口来开发实现呢?
下面代码是基于C#开发的,供大家参考:
stringXMLLayerInfo="
PlugData>
LayerName>
"
+
//这里是要加载的shp文件所在的路径
Application.StartupPath+"
//shp//DC_FF_Parks.shp"
"
/LayerName>
PlugType>
shape<
/PlugType>
Annotation>
0<
/Annotation>
Feature>
1<
/Feature>
AttributesToLoad>
Name,County<
/AttributesToLoad>
+//这里是设置要加载的shp文件的属性字段
StreamedLayer>
/StreamedLayer>
/PlugData>
iLyr=IInfoTree.CreateLayer("
point"
XMLLayerInfo,0);
iLyr.Load();
iLyr.DisplayAs(ObjectTypeCode.OT_LABEL);
iLyr.SetFeature();
iLyr.SetValue("
Text"
PropertyValueType.PROPERTY_CLASSIFICATION,"
ClassificationFuncType='
0'
Class>
Value>
[NAME]<
/Value>
/Class>
DefaultValue>
/DefaultValue>
/Classification>
//==Appearance
iLyr.SetProperty("
ActivationAction"
1);
LinetoGround"
0);
LineLength"
1000);
LineColor"
300);
//==TextOptions
iLyr.SetProperty("
TextColor"
255);
TextSize"
12);
Font"
"
宋体"
Bold"
Underline"
Italic"
MultilineJustification"
BackgroundColor"
100);
BackgroundOpacity"
LockMode"
//==ImageOptions
Imagefile"
C:
\\ProgramFiles\\Skyline\\TerraExplorerPro\\Tools\\Data-Library\\Icons\\Letters\\Letter-a.gif"
//==Position
AltitudeMethod"
Altitude"
Yaw"
10);
Pitch"
Roll"
string[]myStrings=newstring[9];
myStrings[0]="
0,0"
PivotAlignment"
myStrings[0]);
//==Geometry
Scale"
LimitGrowth"
Min.ViewingHeight"
SmallestVisibleSize"
//==Text&
ImageAlignment
TextRelativetoImage"
TextAlignment"
//==General
ShowInBasic"
//---------------------------------------------------
ITerraExplorerMessage5cMessage=null;
stringtMessage="
HelloSkyline"
MsgTypeeMsgType=MsgType.TYPE_TEXT;
cMessage=IObjectManager.CreateMessage(MsgClient.CLIENT_POPUP,tMessage,eMsgType,_HTML_POPUP_FLAGS.HTML_POPUP_ALLOW_RESIZE,"
属性信息"
-1,0,0,300,300,0);
Message"
cMessage.ID.Substring(cMessage.ID.IndexOf('
_'
)+1,(cMessage.ID.Length-cMessage.ID.IndexOf('
)-1)));
ToolTip"
公园"
DefaultViewingDistance"
说明:
上面的代码实现了对点类型的SHP文件的加载和在三维场景中的渲染显示。
五,如何在WPF中嵌入Skyline提供的三维控件
以VS2008开发工具以为:
1、创建VisualC#.NETframework3.0WindowsApplication(WPF)工程
2、添加reference到.NET组件WindowsFormsIntegration
3、添加reference到.NET组件System.Windows.Forms
4、添加reference到前面生成的WindowsFormDLL
5、WPF提供了一个WindowsFormsHost类(需要添加usingSystem.Windows.Forms.Integration;
)用来做WindowsForm的容器,我们要用到的Form控件就必须放进这个容器里。
我们可以在InitializeComponent()后添加:
WindowsFormsHosthost=newWindowsFormsHost();
AxTerraExplorerX.AxTE3DWindowaxTE3DWindow1=newAxTerraExplorerX.AxTE3DWindow();
host.Child=axTE3DWindow1;
this.TEWindow.Children.Add(host);
以上代码创建一个WindowsForm容器,创建WindowsForm控件,将控件添加到容器里,再将容器添加到Grid里,这样界面上就可以看到Form控件了,其布局将受到Grid的控制。
附后台完整代码:
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows;
usingSystem.Windows.Controls;
usingSystem.Windows.Data;
usingSystem.Windows.Documents;
usingSystem.Windows.Input;
usingSystem.Windows.Media;
usingSystem.Windows.Media.Imaging;
usingSystem.Windows.Navigation;
usingSystem.Windows.Shapes;
usingSystem.Windows.Forms.Integration;
//在WPF中使用ActiveX控件需要引用的类
usingTerraExplorerX;
//Skyline提供的类
namespaceWPFA_DEMO
///<
summary>
///InteractionlogicforWindow1.xaml
/summary>
publicpartialclassWindow1:
Window
{
publicWindow1()
InitializeComponent();
WindowsFormsHosthost=newWindowsFormsHost();
AxTerraExplorerX.AxTE3DWindowaxTE3DWindow1=newAxTerraExplorerX.AxTE3DWindow();
host.Child=axTE3DWindow1;
this.TEWindow.Children.Add(host);
privateTerraExplorerTE;
privateITerraExplorer51TE51;
privatevoidLoadFLY()
this.TE=newTerraExplorerClass();
this.TE51=(ITerraExplorer51)TE;
this.TE51.Load(@"
\izhaohe\skyline.fly"
this.TE.OnLoadFinished+=new_ITerraExplorerEvents5_OnLoadFinishedEventHandler(TE_OnLoadFinished);
privatevoidWindow_Loaded(objectsender,RoutedEventArgse)
LoadFLY();
voidTE_OnLoadFinished()
//MessageBox.Show("
ok"
六,SkylineTEPro6.0版本在二次开发方面的改进总结
2011年4月,Skyline推出了最新版本的软件(version6.0),相对于以前版本软件,新版本软件改善和增加了很多新能功能;
同时,开放的APIs也进行了很大的调整,变得更加丰富合理、简单易用。
那么,新版本开放的APIs相对于早期的APIs都有哪些明显变化和改进呢?
1.
TerraExplorer与SGWorld的关系?
在新版本的开发及运行环境中,保持了对以前版本APIs支持的兼容性,通过TerraExplorer接口依然可以调用早期版本的功能APIs;
但如果使用新版本的APIs,则需要通过SGWorld接口来实现;
不同时期的接口可以混合使用;
2.
从软件UI上的变化对应IMenu到ICommand6的变化?
在以前版本中,用户通过IMenu接口可以实现对TerraExplorer(包括View和Pro版本)软件菜单功能的快速调用,而新版本软件的界面风格上做了很大的改变,如果要实现对菜单功能的快速调用,则需要通过ICommand6接口来实现;
3.
从ILayer5到ILayer6的变化?
ILayer6相对ILayer5改进了很多,首先是调整了图层组织结构,增加了FeatureGroups6、FeatureGroup6、Features6、Feature6、IFeatureAttributes6、IFeatureAttribute6等对象;
其次是增加
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Skyline6 用来 BS 开发