javascript - 独立的铯时间轴小部件

标签 javascript cesiumjs

有没有人花时间从 Cesium 应用程序中提取时间轴小部件?我希望在没有 Dojo 依赖项的情况下使用时间轴小部件。我能够找到一个预告片说这是可能的,但时间线示例并不是最容易进行逆向工程的。有谁知道如何提取必要的库并删除 Dojo 依赖项?

google groups timeline discussion

cesium timeline demo

最佳答案

时间线本身(在该演示应用程序之外)不使用 Dojo。以下是其工作原理的示例。你可以Run this demo on Sandcastle .

function onTimelineScrubfunction(e) {
  var clock = e.clock;
  clock.currentTime = e.timeJulian;
  clock.shouldAnimate = false;
}

var timeControlsContainer = document.getElementById('timeControlsContainer');
var clock = new Cesium.Clock();
var clockViewModel = new Cesium.ClockViewModel(clock);
var animationContainer = document.createElement('div');
animationContainer.className = 'cesium-viewer-animationContainer';
timeControlsContainer.appendChild(animationContainer);
var animation = new Cesium.Animation(animationContainer, new Cesium.AnimationViewModel(clockViewModel));
var timelineContainer = document.createElement('div');
timelineContainer.className = 'cesium-viewer-timelineContainer';
timeControlsContainer.appendChild(timelineContainer);
var timeline = new Cesium.Timeline(timelineContainer, clock);
timeline.addEventListener('settime', onTimelineScrubfunction, false);
timeline.zoomTo(clock.startTime, clock.stopTime);
clockViewModel.shouldAnimate = true;


window.setInterval(function() {
  clock.tick();
}, 32);

关于javascript - 独立的铯时间轴小部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32338093/

相关文章:

javascript - React-Native:ScrollView、refs 和自定义组件

cesiumjs - Cesium 从外部数据流动态更新实体

javascript - d3 GeoJSON geoCircle 椭圆等效

javascript - Textarea X/Y 插入符坐标 - jQuery 插件

javascript - 删除图中的节点在js中不能完美工作

javascript - jQuery 用户界面 : draggable behaviour while dropping object using tolerance touch

google-maps - 将高度转换为 z 水平(反之亦然)

javascript - 使用cesiumjs计算两个lat/long/alt点之间的仰 Angular

gis - 如何将大地测量位置转换为与 Cesium 中的地形模型一起使用的 ECF 位置

javascript - {}/a/g 中的/a/g 是正则表达式还是除法?