我正在使用 Cesium 来可视化我的场景,并且我想使用其他移动实体的位置作为其端点的参考在JavaScript 中创建一个多边形。正如使用CZML在这个问题的答案中所建议的那样。
我想知道我是否可以在JavaScript 中做到(将其他实体的位置作为多边形的端点)。我尝试了几件事,但没有奏效,例如,以下是我的代码:
var newPoly= viewer.entities.add({
id : resourceSet[objIndex].id+"poly",
name:resourceSet[objIndex].id+"poly",
availability : new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
start : start,
stop : stop
})]),
polygon:{
hierarchy :{
positions:{
references:[
Cesium.ReferenceProperty.fromString(collection, ''+entityName+'#position'),
Cesium.ReferenceProperty.fromString(collection, ''+baseEntity[0].id+'#position'),
Cesium.ReferenceProperty.fromString(collection, ''+baseEntity[1].id+'#position')
]
}
},
material :Cesium.Color.AQUA.withAlpha(0.5),
perPositionHeight : true,
show : true
},
show: true
})
Run Code Online (Sandbox Code Playgroud)
对于参考我也试过:
entity.positionentity$position.他们都没有工作!
嘿,所以我是webpack的新手,我正在尝试将其用于使用Cesium js api的项目。我正在T上在线学习他们的教程,但是由于某些原因,当我运行命令“ npm run build”时,出现以下错误,但未正确执行。
Peris-MacBook-Pro:App peri$ npm run build
> ngafid@1.0.0 build /Users/peri/Desktop/App
> webpack --config webpack.config.js
(node:23326) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
(node:23326) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
/Users/peri/Desktop/App/node_modules/html-webpack-plugin/lib/compiler.js:81
var outputName = compilation.mainTemplate.applyPluginsWaterfall('asset-path', outputOptions.filename, {
^
TypeError: compilation.mainTemplate.applyPluginsWaterfall is not a function
at /Users/peri/Desktop/App/node_modules/html-webpack-plugin/lib/compiler.js:81:51
at compile (/Users/peri/Desktop/App/node_modules/webpack/lib/Compiler.js:222:11)
at hooks.afterCompile.callAsync.err (/Users/peri/Desktop/App/node_modules/webpack/lib/Compiler.js:470:14)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/peri/Desktop/App/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/peri/Desktop/App/node_modules/tapable/lib/Hook.js:35:21)
at compilation.seal.err …Run Code Online (Sandbox Code Playgroud) 我正在尝试对运行基于WebGL的Cesium的页面进行截图。如果仅截取屏幕截图,则页面将被加载,但webGL不会完成加载。
如果我使用内置的networkidle0或networkidle2,则永远不会截屏。这是我的代码。
这是我想要拍照的网站:https : //www.arelplane.com/@arelenglish
const puppeteer = require('puppeteer');
module.exports = {
takeScreenshot: (userId) => {
(async () => {
const browser = await puppeteer.launch({
headless: false,
args: [
'--headless',
'--hide-scrollbars'
]
});
const page = await browser.newPage();
await page.goto('https://www.arelplane.com/@arelenglish', {"waitUntil" : "networkidle0"});
await page.screenshot({path: 'example.png'});
await browser.close();
})();
return "Successful API call!";
}
}
Run Code Online (Sandbox Code Playgroud) 我想问一个关于在线kml文件到czml文件转换器的问题,因为我想将我的kml文件转换为czml文件,以便在cesium 3d globe中使用它来获取可点击的地标.请给我这个问题的答案.
谁能告诉我如何从GeoJsonDataSource获取位置数据?这是我在做的事情:
entity1 = Cesium.GeoJsonDataSource.fromUrl('../../SampleData/markersdata.geojson');
var array1 = entity1.entities.entities; //According to document, this should an array of entity instances, but it only returns an empty array.
console.log(array1);
// []
//If I do this:
var assocArray = entity1.entities._entities; //This returns an associative array
var markersArr = assocArray.values; //I expect this returns an array of values, but it still returns empty array.
console.log(markersArr);
// []
Run Code Online (Sandbox Code Playgroud)
非常感谢您的帮助!
有没有人花时间从 Cesium 应用程序中提取时间线小部件?我希望使用没有 Dojo 依赖项的时间线小部件。我找到了一个预告片,说这是可能的,但时间线示例并不是最容易进行逆向工程的。有没有人知道我如何提取必要的库并删除 Dojo 依赖项?
我正在使用从数据库提供的位置数据来绘制实体.
我正在使用
viewer.entities.removeAll();
Run Code Online (Sandbox Code Playgroud)
每次从数据库中获取结果时删除所有实体.
这导致浏览器中的漫长而繁重的过程,因为实体当前是3D模型.
是否有更好的数据更新方式,例如实体数组.
或者一种缓存我可以随后改变数据的实体的方法.
最终的结果是我可以动态改变位置,然后在显示屏上看到实体更新
我在用
viewer.entities.add({
name : name,
position : position,
orientation : orientation,
model : {
uri : url,
minimumPixelSize : 50
}
});
Run Code Online (Sandbox Code Playgroud)
添加实体
默认情况下,铯多义线遵循地球的曲率,在两点之间.我如何制作高于地面的弧线,就像在这个例子中一样?
我正在Cesium Earth开发一个用于卫星跟踪的应用程序。
现在,卫星坐标在地球固定系统中,并且工作正常。
但是,我还需要在 ECI 坐标系中显示它们,为此我必须使地球旋转。
怎么做?
我的代码上有两个按钮,单击时将添加和删除基元。另一方面,我有一个onTick方法的事件侦听器,它将作为输入获取活动原语和一个指示其索引的变量,并且应该使用该原语与该事件的特定索引。
当我进行调试时,我看到虽然输入参数已更新,但事件侦听器使用的参数未更新。我得到了对象被破坏的错误。
你知道我如何更新这些参数或停止之前安排的事件吗?