Hi everybody,I´m trying to use checkbox in order to add or remove my layers on the map. I´m using dojo.on, when change my checkbox I use updateLayerVisibility function: map.addLayers([mangroves, coldcoral, marineEcoregions, pelagicProvinces, wmsLayer]); on(dom.byId("mangroves"), "change", updateLayerVisibility); on(dom.byId("coldcoral"), "change", updateLayerVisibility); on(dom.byId("marineEcoregions"), "change", updateLayerVisibility); on(dom.byId("pelagicProvinces"), "change", updateLayerVisibility); function updateLayerVisibility() { //var visibleLayerIds = [] var inputs = query(".list_item"); var inputCount = inputs.length; map.removeAllLayers(); map.setBasemap("oceans"); for (var i = 0; i < inputCount; i++) { if (inputs.checked) { //visibleLayerIds.push(inputs.value); map.addLayer(inputs.value); } if (inputs.checked == false) { map.removeLayer(inputs.value) } } }But I have a problem with the map.addLayer() sentence. When I checked/unchecked in this sentence I have a exception:"uncaught exception: lang.hitch: scope["onLoad"] is null (scope="[object Window]")".I can´t understand where is the error...
thank you..