JS API4.0beta - Looking to start a solution for a table of content selectable layers

3148
6
09-11-2015 09:59 AM
MikeCrook
New Contributor III

ArcGIS JS API 4.0beta is new so I'm not looking for a full solution but a starting solution to a route I can take. Of course, unless there is a full solution for a table of contents with selectable layers.

I know third party support libraries are coming, so maybe I just need a little patience.

Thanks for Reading!

btw - i did ask this same question for the js api 3.14 version and received lots of good solutions.

0 Kudos
6 Replies
AkshayHarshe
Esri Contributor

Hi Mike,

I understand you are willing to have some knowledge about implementing a Table of Content list in the 4.0 API. I believe we we have a widget that is currently available for that in 3.14. If you haven't had a chance to check this out before. Please have a look at LayerList Widget here: LayerList | API Reference | ArcGIS API for JavaScript.

Just bear in mind that this widget is still in Beta and may have some unfixed bugs. As of now this is not available in 4.0 Beta1.

Does that answer your questions?

Let us know if you have any specific questions about starting out on your own for implementing that in 4.0 I will try making some suggestions if possible.

Thanks,

Akshay

Thanks,
Akshay Harshe
0 Kudos
DavidColey
Frequent Contributor

Hi Akshay - can you tell me if the layerList widget in the api is planning on incorporating the legend widget as well? similar to the layerList widget in WAB 1.2?

Or will we continue to have to utilize the 2 together?

Thanks

David

0 Kudos
AkshayHarshe
Esri Contributor

Hi David,

As I mentioned, this widget is still in BETA so as of now it does not work with the legend in the same widget you can check the note in the link I provided in my previous reply.

NOTE: 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.

As of now I do not have that information if there are plans of including a legend in the layerlist widget. But I believe that can be a good enhancement.

Thanks,

Akshay

Thanks,
Akshay Harshe
DavidColey
Frequent Contributor

Hi Akshay - see my post on how you can get at legend content to place as the innerHTML option for the layer list.  It is tricky, especially the indexing differences between map layers and list layers.  Hopefully the new release will make the work we did in the post below easier

LayerList and setting Legend graphics

Thanks

David

0 Kudos
MikeCrook
New Contributor III

I found a TOC solution for JS API 3.x. It works great, however when I upgraded to Esri JS API 4.0beta1 (now on JS API 4.0beta2) it broke. The TOC doesn't support JS API 4.x new version; so I'm simply looking for a new TOC solution using ESRI's new JS API 4.x version.  Thanks for your reply!

0 Kudos
AkshayHarshe
Esri Contributor

Hi Mike Crook,

The Beta version does not have all the widgets included in it. Even if you can access the module it may not work properly. Further versions of Beta will add more widget to the API. As of now, widgets that you can see in API Reference of Beta 2 are the only ones that are  working.

Check under widgets at Index | API Reference | ArcGIS API for JavaScript.

I will strongly recommend that you use the Beta Versions for Proof of Concept and testing.

Let me know if that helps.

Thanks,

Akshay

Thanks,
Akshay Harshe
0 Kudos