Having Issue on Adding/Removing Service Layer by Checkbox In ArcGIS API

المشرف العام

Administrator
طاقم الإدارة
Can you please take a look at this code and let me know how I can add and remove some layers based on their index number in a Map Service? I tried this before but it is not working! Here is the HTML part:

Layer 52 :
Layer 53 :
and the js is:

var service ="http://renewablestoolbox.biol.sfu.ca/rorapp/rest/services//RORApp/MapServer"; $('input:checkbox[name=overlayLayers]').on('change', function(){ if($(this).is(':checked')){ var index = $(this).val(); map.addLayer(service+index); } else{ var index = $(this).val(); map.removeLayer(service+index); }});

أكثر...
 
أعلى