《cesium编程入门(五)绘制形状》的评论 http://cesium.xin/wordpress/archives/102.html 学习cesiumjs 的好地方--伐罗密 Sun, 12 Oct 2025 08:07:13 +0000 hourly 1 https://wordpress.org/?v=4.9.28 作者:方龙 http://cesium.xin/wordpress/archives/102.html#comment-3201 Mon, 25 Jul 2022 02:49:37 +0000 http://cesium.xin/wordpress/?p=102#comment-3201 我用的是vue。对源码稍加修改即可运行示例。
在vue的mounted()生命周期里执行load()函数。load()函数如下。
load(){
Cesium.Ion.defaultAccessToken = “eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhMGU0MDRiMC04NDZiLTRlZGUtOTFjOS00OThmOWJhYjBiOTkiLCJpZCI6MTAyMjk0LCJpYXQiOjE2NTg2NDY4NTF9.mef7uY2FZ9zicOFvcAs-KAngdfRU27eRh2BOXq9BcxY”
this.viewer = new Cesium.Viewer(“cesiumContainer”)
let redBox = {
name : ‘Red box with black outline’,
position: Cesium.Cartesian3.fromDegrees(-107.0, 40.0, 300000.0),
box : {
dimensions : new Cesium.Cartesian3(400000.0, 300000.0, 500000.0),
material : Cesium.Color.RED.withAlpha(0.5),
outline : true,
outlineColor : Cesium.Color.BLACK
}
}
this.viewer.entities.add(redBox);
this.viewer.zoomTo(this.viewer.entities);
}

]]>
作者:Elusive http://cesium.xin/wordpress/archives/102.html#comment-2393 Mon, 07 Mar 2022 03:32:32 +0000 http://cesium.xin/wordpress/?p=102#comment-2393 viewer.dataSources.removeAll(); viewer.dataSources.remove();

]]>
作者:我是cesium的fans http://cesium.xin/wordpress/archives/102.html#comment-2391 Sat, 05 Mar 2022 10:27:43 +0000 http://cesium.xin/wordpress/?p=102#comment-2391 czml的数据模型加载之后,如何删除?麻烦博主给提供一下API方法。感谢

]]>
作者:1125346480 http://cesium.xin/wordpress/archives/102.html#comment-1615 Sun, 20 Dec 2020 09:03:45 +0000 http://cesium.xin/wordpress/?p=102#comment-1615 所以我要是设置距离地面1000米,但是box高度是2000米的话,那看着效果就不对了?

]]>
作者:2948236166 http://cesium.xin/wordpress/archives/102.html#comment-1609 Fri, 18 Dec 2020 10:00:10 +0000 http://cesium.xin/wordpress/?p=102#comment-1609 我这边可以运行站主的代码,用的是http-server发布

]]>
作者:Elusive http://cesium.xin/wordpress/archives/102.html#comment-1467 Sat, 21 Nov 2020 10:01:04 +0000 http://cesium.xin/wordpress/?p=102#comment-1467 发布了没有?具体表现是什么?

]]>
作者:Elusive http://cesium.xin/wordpress/archives/102.html#comment-1465 Sat, 21 Nov 2020 09:59:37 +0000 http://cesium.xin/wordpress/?p=102#comment-1465 使用了worker

]]>
作者:laingwenbiao http://cesium.xin/wordpress/archives/102.html#comment-1462 Fri, 20 Nov 2020 02:29:39 +0000 http://cesium.xin/wordpress/?p=102#comment-1462 请问为什么THREEJS写的html文件可以直接用浏览器打开,而Cesium工程必须要用服务器发布后才能打开呢

]]>
作者:laingwenbiao http://cesium.xin/wordpress/archives/102.html#comment-1454 Thu, 19 Nov 2020 03:05:17 +0000 http://cesium.xin/wordpress/?p=102#comment-1454 有毒,给的例子代码都无法运行

]]>
作者:星雪火 http://cesium.xin/wordpress/archives/102.html#comment-1312 Wed, 04 Nov 2020 08:41:16 +0000 http://cesium.xin/wordpress/?p=102#comment-1312 琢磨了一下,发现形状的坐标是以中心点为基准。
也就是说当z轴坐标为形状高度的一半时,形状是刚好在地面上的,例如这样:
position:Cesium.Cartesian3.fromDegrees(-107.0,40.0,200000.0),

dimensions:new Cesium.Cartesian3(400000.0,300000.0,400000.0),

]]>