AnsweredAssumed Answered

Get Rid of comma in layer list

Question asked by nathalieneagle on Apr 25, 2012
Latest reply on Mar 11, 2014 by mvolz47
I want to use the layer list but I want my list to be vertically aligned not horizontal like the example (http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm).

I added a break point in the JS and now have the vertical affect but I can't shake the Comma separator.  How do I Get Rid of comma in layer list?


 //Code for layer list     function buildLayerList(Baselayers) {         var items = dojo.map(Baselayers.layerInfos,function(info,index){           if (info.defaultVisibility) {             visible.push(info.id);           }           return "<input type='checkbox' class='list_item' checked='" +            (info.defaultVisibility ? "checked" : "") + "' id='" + info.id +            "' onclick='updateLayerVisibility();' /><label for='" + info.id + "'>" + info.name + "</label>" + "<br />";         });          dojo.byId("layer_list").innerHTML = items.join();         // Baselayers.setVisibleLayers(visible);         //map.addLayer(Baselayers);        }        function updateLayerVisibility() {         var inputs = dojo.query(".list_item"), input;             visible = [];          dojo.forEach(inputs,function(input){           if (input.checked) {               visible.push(input.id);           }           });         //if there aren't any layers visible set the array to be -1         if(visible.length === 0){           visible.push(-1);         }         Baselayers.setVisibleLayers(visible);       }  //end code for layerlist 


Thanks
Nathalie

Outcomes