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

11861
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
by Anonymous User
Not applicable

Matt, I'm a big fan of your weather widgets. And your other code on Git. Thanks by the way!

I respectfully would say though that your TOC feature list is actually exactly what many would like to see.  In fact, I think every one of those items would be highly useful. In particular, the Legend.

Combining the Legend with TOC is intuitive. Users see what they are turning on and off. Particularly when services from things like federal agencies have cryptic names and going by symbol makes more sense or when there are many sublayers.  Many of our users say a separate legend and TOC is frustrating. They have to look between the two.

Individual transparency is also very useful, such as for example with different years of imagery or DEMs etc.  Again, same implementation as AGS JS TOC or ArcGIS.com TOC will work. 

- Greying out scale dependent sublayers. (parent layers already do this)

- Collapsable option or sublayers collapsed when not visible.

If the parent layer does not sync up to the sublayers, like hierarchical menus do in every application, be it ArcMap TOC or Windows Explorer, it is confusing: If the parent layer turn of the layers, (and roll them up) when you turn it off, it should not be a Checkbox. Just a static text string (the name of the layer.) Otherwise users would expect it to behave like a checkbox when it does not. I had thought this was a bug. And it would save space in TOC vertically, so it would seem beneficial. Same concept goes for greying out, user interface should be consistent.

Perhaps you could always add these features as an option, and let us decide activate or use all these features but leave them off by default?

Anyone else think these features would be useful in a TOC in the API?

0 Kudos
by Anonymous User
Not applicable

One last thought, the "+" to the left of each TOC layer in AGS TOC implies it is a group, and it becomes a "-" when expanded to imply it can then be rolled up, and this would be good to add. Currently only indentation of text implies sublayers belong to a parent. The "+" icon is widely recognized to signify a dropdown group. Another icon that would work is a dropdown menu arrow, with ► to open and ▼ when expanded.

0 Kudos
by Anonymous User
Not applicable

all right.. one last thought!  Add a tooltip on greyed-out scale dependent layers. So when hovered over it advises users to zoom in. Perhaps include a variable with the level they'll need to zoom to, to see it. Eh, maybe just saying to zoom in. Less is more. Should be trivial. HTML tooltip.  Users sincerely appreciate when interface behavior is explained upfront.

SimonFisher
Occasional Contributor II

I would have to agree with Kevin's suggestions. Adding the + - or arrow collapsing option would be great, and the legend in the layer list is great visual feedback for users and nicer than a separate legend.  Basically exactly what is in the WAB Layer control.

by Anonymous User
Not applicable

Simon Fisher​ And many agree with us.. There are Ideas pages for TOC in the JS API.  Perhaps these and others can be combined:

https://c.na9.visual.force.com/apex/ideaView?id=087300000008G6BAAU https://c.na9.visual.force.com/apex/ideaSearchResults?s=javascript+toc&searchButton=search

https://c.na9.visual.force.com/apex/ideaView?id=087E00000004b8eIAA

It has been requested for the JS API and its precursors now for a while-  TOC control for multiple dynamicMapServiceLayers  

0 Kudos
by Anonymous User
Not applicable

Oh sorry, thanks for pointing that out. Oh well, the TOC ideas are discoverable on there in Search. 

New Idea: make sharing Ideas via URL work. Or include a little <link> button. Not in that Sharing thing just a separate button next to it.

The current sharing (also should remove the mouseover) has like 100 sharing things. Except a plain URL.  I looked and gave up. Using "Google" gave me 404. Email didn't work either. But it has LiveJournal.  Thank God.  You can share it there with the other 8 people in the world that forgot to delete their LiveJournal from 1999!  

0 Kudos
SimonFisher
Occasional Contributor II

Matt,

When would the LayerList widget come out of Beta? do we have to wait for 3.15? or do you update 3.14 to move it out of Beta?

By the way, I have implemented the LayerList and added the transparency sliders, and so far so good.  When playing with it in our application definitely the most standout missing feature is the expand/collapse functionality. Would want to set everything collapsed by default.  Without this it makes for a long scrolling list of layers, sub layers and when scrolling it's also somewhat difficult in the UI to see exactly what is a service versus layer, versus layer group, sub layer, as the indent is small and does not standout. 

Again, thanks for your work on this, its really helped me out at the right time.

Simon

0 Kudos
by Anonymous User
Not applicable

Example of a full-powered TOC.  BIOS Viewer by CDFW

bonus: has links to metadata   (actually, links to the REST pages, not as powerful as Jeff's approach below, but is very nice)

0 Kudos
SimonFisher
Occasional Contributor II

I found the following issue with the Layer List Widget and have submitted a bug.

The Layer List Widget does not show WMS layer names correctly when adding a WMS service, instead it shows numbers like 0, 1, 2. Note the legend widget does show the correct layer names.