三维软件Skyline做出来的东西有点炫,挺高大上的样子。那么for web的二次开发是啥门道呢?
其实,就是一个ActiveX控件而已。
所以,skyline for web的开发,首先浏览器端要安装一个skyline的软件Skyline TerraExplorer Pro;所以,只能在IE上运行,chrome是不行的。官网上也声称有个啥for web的软件,可以支持谷歌、火狐等主流,但暂时没找到。
因为只是一个ActiveX,不想 Arcgis for Javascript那样,有很完整的Javascript库,只有一些API而已。并且相关资料非常少,基本上唯一的依靠,只有官网上的这个API说明:
http://www.skylineglobe.com/skylineglobe/corporate/developer/dev_api.aspx
调用起来相对简单,没有什么CSS,JS。就是这样用:
<html xmlns&#61;"http://www.w3.org/1999/xhtml">
<head><title>HTML Exampletitle><script type&#61;"text/Javascript">function Init() {try {var flyPath &#61; "http://www.skylineglobe.com/SkylineGlobe/WebClient/PresentationLayer/WebClient/SkyglobeLB.fly";SGWorld66.AttachEvent("OnLoadFinished", OnProjectLoadFinished);SGWorld66.Project.Open(flyPath);}catch (e) {alert("Error: " &#43; e.description);}}function OnProjectLoadFinished() {alert("Received project loaded event. Click OK to fly to Washington DC.");var Washington &#61; SGWorld66.Creator.CreatePosition(-77.036667, 38.895111, 1500);SGWorld66.Navigate.FlyTo(Washington);}script>
head>
<body onload&#61;"Init()"><object id&#61;"TE" classid&#61;"clsid:3a4f9192-65a8-11d5-85c1-0001023952c1" style&#61;"width: 600px;height: 600px">object><object id&#61;"SGWorld66" classid&#61;"CLSID:3a4f9199-65a8-11d5-85c1-0001023952c1" style&#61;"visibility: hidden;height: 0">object>
body>
html>