Developing a Table of Contents to turn on\off layers... anyone try this?

11877
47
Jump to solution
04-10-2015 09:01 AM
MikeCrook
New Contributor III

I'm developing a Table of Content to turn on\off layers on map using javascript \ dojo-AMD sdk. I found a few places on the internet that shows ways. Nothing that is making complete sense to a newbie. Has anyone done this in a way that makes sense?

Tags (1)
47 Replies
HeatherGonzago
Esri Contributor

Are you coming across what is doc'd as a current known limit?

A legend is not included along side each layer. Use the Legend widget for displaying information about the layers. Toggling of map services, KML and WMS sublayers outside of the widget is not supported, in addition to sublayers that are out of scale range.

0 Kudos
SimonFisher
Occasional Contributor II

I don't think so, I know a legend is not available and I am not toggling WMS layers outside of the widget.  I just want the WMS layer names to display properly.  The layers show up as 0, 1, 2 beside the check boxes where they should show the actual layer name like rivers, cities etc.

0 Kudos
HeatherGonzago
Esri Contributor

Alright, then it may be a bug. It sounds like you already logged an issue in with Support, correct? If so, they will test this out and get it in our bug tracking system.

Thanks for pointing it out.

0 Kudos
SimonFisher
Occasional Contributor II

Yes I did submit a bug report.

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Simon & Heather Gonzago

I test with WMSLayer that has three layers. And I check the capabilities of this WMSLayer and here is the url: http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServe...

- Press Ctrl+F in browser to search keyword “name”, as you can see all the layers in WMSLayer are named as “0,1,2”. Therefore technically speaking, the new layer widget does return the WMSLayer name correct. However, I do understand that you want to show the layers “real name”. If that’s the case, then the tag <title>in WMSLayer xml might be the one. Is this what you looking for?

JeffJacobson
Occasional Contributor III

-ability to alter transparency of each service

-included legend

-ability to move services up/down

And gray out scale dependent layers beyond scale.  [Looks like they're planning to add this feature]

The layer list widget I created has those features. The code is in the public domain if anyone wants to incorporate it into the ArcGIS API's layer list.

Esri's GitHub issues list would be a good place to request features.

by Anonymous User
Not applicable

Jeff, that's cool that you include links to layer metadata in the TOC. Really nice idea!

Fyi in Chrome some of the sublayer legend divs are getting cut off, perhaps a CSS issue. Do you see it?

0 Kudos
JeffJacobson
Occasional Contributor III

I think I see what you are talking about with feature layers. Since they don't actually have sublayers, there is nothing to show in that div at the moment. (Ideally the legend for these layers would go here, but I haven't figured that part out yet.)

The metadata feature requires an SOE we created to be installed on your ArcGIS Server, as ArcGIS Server doesn't expose this type of metadata on its own.