Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help] Exclude feature layers from TOC #218

Closed
mosanderonimo opened this issue Sep 18, 2014 · 4 comments
Closed

[Help] Exclude feature layers from TOC #218

mosanderonimo opened this issue Sep 18, 2014 · 4 comments

Comments

@mosanderonimo
Copy link

Is there a way to exclude operational layers from the TOC? I have a couple of invisible featurelayers that I use to populate attribute tables. They are always on, so they don't need to clutter up the TOC. I see that by using noLegend: true, I can exclude a layers symbology, but that still leaves the layer name in the TOC.

Thanks for your help!

@tmcgee
Copy link
Member

tmcgee commented Sep 18, 2014

With the current TOC I found no way to exclude layers. Ultimately what I did was hide the DOM elements for the particular layer that I wanted hidden with CSS.

The new LayerControl that is replacing the TOC in the next release has an option to exclude a layer. It is configured for the operational layer like this:

layerControlLayerInfos: {
    exclude: true
}

@btfou
Copy link
Contributor

btfou commented Sep 18, 2014

@mosanderonimo @tmcgee The config object is actually controlOptions.

{
    type: 'dynamic',
    url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer',
    title: 'Louisville Public Safety',
    options: {
        //layer options
    },
    controlOptions: {
        exclude: true
    }
}

@tmcgee
Copy link
Member

tmcgee commented Sep 18, 2014

@btfou not since I changed it. ;) There was discussion in Trello about that. I changed yesterday but the change got lost in the merge. changed it again minutes ago.

@mosanderonimo
Copy link
Author

Thanks guys! The new LayerControl widget looks great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants