cesium学习记录(二)- 可视化空间数据Viewer 中的Entity

Unless we specifically disable it, clicking on an entity in the Viewer will show the SelectionIndicator widget at the Entity’s location as well as bring up the InfoBox widget to provide more information. Going back to our original example, we only supplied the wyoming entity with a name, which determines the title of the InfoBox, but we can also provide additional data in HTML via the Entity.description property. Let’s add the below block of code to the end of the first example.

除非我们特别禁用它,否则在查看器中单击一个实体将显示该实体位置的selectionIndicator小部件,并打开InfoBox小部件已展示提供更多信息。回到我们最初的示例,我们只提供了wyoing实体的名称,它决定了InfoBox的名称,但是我们也可以通过entity.description属性提供HTML中的额外数据。让我们将下面的代码块添加到第一个示例的末尾。



设置实体描述允许在infoBox中显示的HTML 格式的信息

Many applications will retrieve descriptions from the server rather than using a hard coded string, but either approach is valid.


By default, all HTML shown in the InfoBox is sandboxed. This prevents external data sources from injecting malicious code into a Cesium application. If you want to be able to run JavaScript or browser plug-ins inside of a description, you can access the iframe used for sandboxing via the viewer.infoBox.frame property. See this article for more information on controlling iframe sandboxing.

许多应用程序将从服务器检索描述,而不是使用硬编码的字符串,但是这两种方法都是有效的。
默认情况下,在InfoBox中显示的所有HTML都是沙盒化的。这可以防止外部数据源向Cesium应用程序中注入恶意代码。如果您希望能够在描述中运行JavaScript或浏览器插件,那么您可以通过viewer.infobox.frame属性访问用于沙箱的iframe。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值