惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
Jina AI
Jina AI
H
Help Net Security
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
L
LangChain Blog
Recorded Future
Recorded Future
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
GbyAI
GbyAI
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
M
MIT News - Artificial intelligence
爱范儿
爱范儿
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Y
Y Combinator Blog
B
Blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
MongoDB | Blog
MongoDB | Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
The Cloudflare Blog
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
D
DataBreaches.Net
博客园 - 【当耐特】
T
Troy Hunt's Blog
V
Visual Studio Blog
V2EX - 技术
V2EX - 技术
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog

博客园 - 依尔根觉罗天赫

2024年上半年实景三维相关项目建设内容 智慧城市基础设施与智能网联汽车协同发展试点城市 城市CIM基础平台需求调查结果 新城建试点城市 住建部第一批城市更新试点名单 不动产测绘包含哪些内容 CIM基础平台性能指标 日照的那片海 Cesium地下模式应用示例 nginx-1.12.2解决跨域问题nginx.conf设置参考记录 遥望北戴河 SkylineGlobe 7 版本TerraExplorer Pro二次开发快速入门 SkylineGlobe 7.0.1 & 7.0.2版本Web开发 如何实现土方量计算 SkylineGlobe 7.0.1 & 7.0.2版本Web开发 如何实现对三维模型和地形的剖切展示 SkylineGlobe 7.0.1 & 7.0.2版本Web开发 如何正确使用三维地图控件和工程树控件 如何解决一个从SkylineGlobe5版本升级到7版本遇到的小问题 Cesium如何通过addImageryProvider方法加载SkylineGlobe Server发布的WMS服务 SkylineGlobe7.0.1版本 支持SQLite(*.sqlite;*.db)数据库 SkylineGlobe7.0.1版本 通过鼠标左右平移模型对象
SkylineGlobe TerraExplorer for Web 7.1.0版本 接口示例
依尔根觉罗天赫 · 2018-05-30 · via 博客园 - 依尔根觉罗天赫

在SkylineGlobe TerraExplorer for Web 7.1.0版本(俗称H5免插件版本)中,如何使用SGWorld接口的三维视域分析方法呢?

请参考下面的示例:

通过下面的代码大家不难发现,这个函数方法是基于Cesium的接口重新封装的,示例代码里面也混杂了一些Cesium的接口,

这样看,如果以后我们要用Skyline的这个H5免插件版本做开发,Cesium的接口也要一并学习啦。

var MyViewshedTool = function () {

 

    //SET TOOL ID   

    this.getId = function () {

        return 'MyViewshedTool';

    },

 

        //SET MENU ENTRY FOR THE TOOL (See example 1 for more details)

        this.getMenuEntry = function () {

            return TerraExplorer.tools.MenuEntry.addToSidebar(this, "My Viewshed Tool", "./userTools/myToolIcon.png", 3, TerraExplorer.tools.MenuEntry.MenuEntryAnalysis(), "My Tools");

        },

 

        //SET CODE TO EXECUTE WHEN TOOL IS CLICKED IN SIDEBAR

        this.open = function () {

            //CREATE A MESH LAYER USING THE CreateMeshLayer METHOD

            var promise = TerraExplorer.SGWorld.Creator.CreateMeshLayer("Frederick", "http://www.SkylineGlobe.com/SG/streamer.ashx", "Frederick_4TEDF", true);

            promise.then(function (teObject) {

                //PRINT DESCRIPTION OF ADDED LAYER

                console.log("Created Mesh layer: " + teObject.description);

                //FLY TO Frederick USING THE camera.flyTo METHOD

                viewer.camera.flyTo({

                    destination: new Cesium.Cartesian3.fromDegrees(-77.40982, 39.41875, 600), //Frederick coordinates

                    orientation: {

                        heading: Cesium.Math.toRadians(180.0),

                        pitch: Cesium.Math.toRadians(-55.0),

                        roll: 0.0

                    },

                    complete: function () {

                        var hpra = new Cesium.HeadingPitchRange(Cesium.Math.toRadians(90.0), -45, 2000);

                        var vsPositionCarto = new Cesium.Cartesian3.fromDegrees(-77.41319, 39.41702, 300); //Other Frederick coordinates

                        //CREATE VIEWSHED OBJECT USING THE CreateViewshedObject METHOD

                        TerraExplorer.SGWorld.Analysis.CreateViewshedObject('Viewshed On Frederick', vsPositionCarto, 53, 53, hpra, { roll: 0.0 });

                    }

                });

            }).otherwise(function (err) {

                alert(err);

            });

 

            return true;

        }

};