Customise LayerList view to show actual featureclass layers under their parent as category

423
0
09-20-2021 05:41 AM
AndyClark2
New Contributor II

Hi there. I have developed in the ESRI Javascript API (<v4) for a few years now, and we're looking to move our main application into Portal. Almost everything we programmed years ago can be one, with the exception of the LayerList.

Our old application takes the Layer tree of a single map service and collects layers with no subLayerIds under a category node defined by the parents 'name'.

The internal map service is created from a public service mxd, with layer files dragged into the root of the map document. These layer files are in group layers named the same as the public ones, so when the code reads from the internal service it just merges the internal featureclass layers into the same group name as the public ones, to generate the layerlist.

Map service layers:

  • Layers
    • Public 
      • Category A
        • Layer 1
        • Layer 2
      • Category B
        • Layer 3
      • Category C
        • Layer 4
    • Internal
      • Category A
        • Layer 5
      • Category C
        • Layer 6
        • Layer 7

Output LayerList:

  • Category A
    • Layer 1
    • Layer 2
    • Layer 5
  • Category B
    • Layer 3
  • Category C
    • Layer 4
    • Layer 6
    • Layer 7

So this is what I'm trying to reproduce in a custom LayerList widget and I haven't a clue where to start, so any clues?

Tags (3)
0 Kudos
0 Replies