Here is what I'm trying to do with the Layer List.
I have layers in my mxd that have sublayers upon sublayers. Here is an example shown below my question. So in my mxd I have a group layer, 2015 - March Ridership, which then has a sublayer (Weekdays, Saturdays, Sundays), all of which have another sublayer (Ons, Offs). Is there a way to utilize the layerList to do this? If not, how can I set it up to simply show one sublayer (see Ex. 2)? I have tried and tried with no luck.
Ex. 1
2015 - March Ridership
- Weekdays
- Ons
- Offs
- Saturdays
- Ons
- Offs
- Sundays
- Ons
- Offs
2014 - September Ridership
- Weekdays
- Ons
- Offs
- Saturdays
- Ons
- Offs
- Sundays
- Ons
- Offs
Ex. 2
2015 - March Weekdays
- Ons
- Off
2015 - March Saturdays
- Ons
- Offs
2015 - March Sundays
- Ons
- Offs
Currently my widget looks like this as I can't seem to get the sublayer: true working:
var ridershipWidget = new LayerList(
{
map: map,
layers: [
{
layer:mar15SaturdaysOff
}, {
layer:mar15SaturdaysOn
}, {
layer:mar15WeekdaysOff
},{
layer:mar15WeekdaysOn
}
]
}, "ridershipList"
);
ridershipWidget.startup();