Controlling position and width of LayerList panel

573
4
Jump to solution
12-13-2023 02:05 PM
DavidShearan
New Contributor III

I have spent the last couple of days working out how to use multiple layers and then to display the LayerList panel to give users of the website the ability to show/hide those layers.

My screenshot attachment shows my progress to date. I would now like to be able to control the position of the panel so that it does not cover up parts of the map. Ideally that would mean displaying it below the viewdiv position if possible. Failing that I would like to reduce the width of the panel. Perhaps then by altering the layout of the screen I could provide more space for the map.

If you need anything else from me then please do let me know

0 Kudos
2 Solutions

Accepted Solutions
Sage_Wall
Esri Contributor

Hi @DavidShearan ,

You can place the LayerList widget in any HTML element by specifying the element using the `container` property.  Codepen that sets the container right below the #viewDiv: https://codepen.io/sagewall/pen/LYqKPYp

View solution in original post

0 Kudos
DavidShearan
New Contributor III

Thank you. After experimenting with calcite I did some more searching and came to the same conclusion as you.

It’s great to have your endorsement. Thank you. I will mark this as solved now.

View solution in original post

0 Kudos
4 Replies
LefterisKoumis
Occasional Contributor III

create a calcite panel at the start or end and place the layerlist widget inside the panel.  

0 Kudos
DavidShearan
New Contributor III

Thank you. Great reply and really quick. I will check this out later today but at first sight looks like just the thing I need and it’s something else for me to get familiar with. 

I will mark it as solved when I apply it

0 Kudos
Sage_Wall
Esri Contributor

Hi @DavidShearan ,

You can place the LayerList widget in any HTML element by specifying the element using the `container` property.  Codepen that sets the container right below the #viewDiv: https://codepen.io/sagewall/pen/LYqKPYp

0 Kudos
DavidShearan
New Contributor III

Thank you. After experimenting with calcite I did some more searching and came to the same conclusion as you.

It’s great to have your endorsement. Thank you. I will mark this as solved now.

0 Kudos