am creating a web map to show Sea Level Rise in my County. I want to use a Slider for a user select the increment of Sea Level Change that wish to see.
I have been able to create Programatically create the Slider using:
var vertSlider = new VerticalSlider({
minimum: 0,
maximum: 10,
discreteValues: 1,
//value: 0,
intermediateChanges: true,
style: "height: 200px; width: 15px;",
onChange: function (value) {
dom.byId("sliderValue").value = value;
}
}, "vertSlider");
The maps layers are created with:
var layer1 = new ArcGISTiledMapServiceLayer("http://url");
var layer2 = new ArcGISTiledMapServiceLayer("http://url");
... and so on till 10 layers are added.
I need now to be able to pass the value of the slider to draw one of my map layers. So when the slider is moved from position 1 to 2, layer 1 would be turned off and 2 would display.
How would i do this using JS or the ESRI API? There are many examples using the TimeSlider, but those do not translate to the Dojo Slider.