有没有人花时间从铯应用程序中提取时间线小部件?我希望使用没有Dojo依赖项的时间线小部件。我找到了一个戏谑者说这是可能的,但时间线的例子并不是最容易逆转工程师。有人知道我如何提取必要的库并删除Dojo依赖关系吗?
铯时间线演示
发布于 2015-09-01 22:29:27
时间线本身(在演示应用程序之外)不使用Dojo。这是一个如何工作的例子。你可以在沙堡上运行这个演示。
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);https://stackoverflow.com/questions/32338093
复制相似问题