Created
May 12, 2020 10:14
-
-
Save RalucaNicola/e0da13acc73315b270ce6c1258345fd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const start = new Date(1900, 0, 1); | |
const end = new Date(2020, 0, 1); | |
const timeSlider = new TimeSlider({ | |
container: "timeContainer", | |
mode: "cumulative-from-start", | |
fullTimeExtent: { | |
start: start, | |
end: end | |
}, | |
values: [end], | |
stops: { | |
interval: { | |
value: 5, | |
unit: "years" | |
}, | |
timeExtent: { start, end } | |
} | |
}); | |
timeSlider.watch("timeExtent", function (timeExtent) { | |
const maxYear = timeExtent.end.getFullYear(); | |
layer.definitionExpression = `yrbuilt <= ${maxYear}`; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment