I am customizing add widget and want to add new layers after a define html .. which is defined in widget.html in layerlist widget. Also I am adding layers by layer list widget..
by default the layer are adding on top i want them in after the html.
Please find snapshot for better understanding
Any lead on this is highly appreciated
Thanks
Ash
???... I am totally at a loss here. what are you asking?
Hi Robert
I guess this image will give a better picture to you.
Its like some layer I have added by layer list widget and there is some other HTML . I then want to add more layers from add data widget provided it should come after html but by default it is coming in the section above HTML
Thanks
Ash
OK, I see what you are after now but sorry I don't have any suggestions.
Thanks Robert for your pointers
If i'm understanding your situation correctly, you want to have a custom widget that consists out of :
The first layerlist widget should match the initial webmap layers, and the second layerlist should match the newly added layers.
An important note to take from the Layerlist widget is: when providing a "layers" param, the layerlist will only listen to changes to these provided layers. So for the first requirement, the first layerlist... it can easly be done, by using 'jimu/LayerStructure' to build the initial layer tree.
tip :
LayerStructure.getInstance().getWebmapLayerNodes();
This is why it's being added above your HTML block, if the layers property of the map LayerList widget is undefined, it will take the list from the map.
- see : https://developers.arcgis.com/javascript/3/jsapi/layerlist-amd.html#layers
Then for the second layerlist you'll need to listen to the map's "layer-add" event and add it to your second layerlist.
- see Map | API Reference | ArcGIS API for JavaScript 3.28