How to create an if else condition with ArcGIS Javascript API for slider and imageLay

المشرف العام

Administrator
طاقم الإدارة
The code below is the switch statement that I am currently using. I can't seem to get the values (case) to match up with the horizontal slider I am using (4 unique values-each layer). I was thinking of trying an if else condition instead. Anyone have the best way to accomplish this?

function setPixelFilter() { var val = slider.get("value"); switch (val) { case 0: var imageLayer = new ArcGISImageServiceLayer("https://...ImageServer") map.addLayer(imageLayer) break; case 100/3: var imageLayer = new ArcGISImageServiceLayer("https://...ImageServer") map.addLayer(imageLayer) break; case 100/3*2: var imageLayer = new ArcGISImageServiceLayer("https://...ImageServer") map.addLayer(imageLayer) break; case 100: var imageLayer = new ArcGISImageServiceLayer("https://...ImageServer") map.addLayer(imageLayer) break;

أكثر...
 
أعلى