LayerInfos and Adding Layers

47
0
01-27-2022 11:25 AM
NathanHeickLACSD
Occasional Contributor III

Does anyone know how LayerInfos relates to adding layers?  Can it be used to add a layer?  I tried adding a layer with map.addLayer and I noticed two things.  First, LayerInfos.getLayerInfoArray() returned the operational layers in the map from top to bottom, whereas the map.basemapLayerIds, map.layerIds, and map.graphicLayerIds all list the layers from bottom to top.  Second, after I added a new layer getLayerInfoArray returned the same results.  Is it static after the map loads or is there a way to make it update?  I noticed an addTable method, but I didn't see an addLayer method.  I just want to know if there is a proper way to use LayerInfos to dynamically add, access, and move layers and tables around the map.

0 Kudos
0 Replies