This question is about NLiu's TOC widget. If i've understood correctly, the layerInfos for the TOC takes dynamic map services and feature layers. Our app includes services from various cities, with a service for each city's particular data category (e.g. City1_Water, City1_Electric, City1_Gas, City2_Water, City2_Electric, City2_Gas). I've integrated each as a dynamic map service.
So I currently added them to the TOC with success in this way. However, I'm looking to group things one level further, by City. Is there any way to do this out of the box? If not, any suggestions on tweaking the widget to do so?
toc = new TOC({
map: window.myMap,
layerInfos: [
{
layer: City1_Water,
title: "City1_Water",
collapsed: true
},
{
layer: City1_Electric,
title: "City1_Electric",
collapsed: true
},
{
layer: City1_Gas,
title: "City1_Gas",
collapsed: true
},
{
layer: City2_Water,
title: "City2_Water",
collapsed: true
},
{
layer: City2_Electric,
title: "City2_Electric",
collapsed: true
},
{
layer: City2_Gas,
title: "City2_Gas",
collapsed: true
}
]
}, 'legendDiv');