Snippets

Piotr Szrajber Geospatial Portal - programatically increment global time slider

Created by Piotr Szrajber
var dateField = Ext.getCmp("timedimension-current-picker"),
    slider = Ext.getCmp("timedimension-time-slider"),
    T = Intergraph.WebSolutions.Core.WebClient.Platform.Common.TemporalUtils,
    mapStateId = "map",
    dict = {};

var commonInterval = T.getCommonDateInterval(T.getAllExtents("map"), dict),
    step = ((timeSlider.maxValue - timeSlider.minValue) / timeSlider.width) | 0;

function notify() {
    var d = dateField.getValue();
    $mapStateManager.findMapState(mapStateId).set_globalTime(d);
    $event.notify("globalTimeValueChanged", {
        time: d,
        format: T.getFormatISO(dict.resolution)
    }, this)

}

function nextStep() {
    var newValue = slider.getValue() + step;
    slider.setValue(newValue <= slider.maxValue ? newValue : slider.minValue);
    notify();
}

// in SetInterval ?
nextStep();

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.