有没有人花时间从 Cesium 应用程序中提取时间线小部件?我希望使用没有 Dojo 依赖项的时间线小部件。我找到了一个预告片,说这是可能的,但时间线示例并不是最容易进行逆向工程的。有没有人知道我如何提取必要的库并删除 Dojo 依赖项?
时间线本身(在该演示应用程序之外)不使用 Dojo。这是一个如何工作的示例。您可以在 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);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2892 次 |
| 最近记录: |