I exported a leaflet-webmap with qgis2web. On the top-left, there are the controls (like zooming, serching etc.). On the top-right, there is the layers control box (checking/unchecking the layers of the map). This is the one I want to change.

I want to move the layers control box to the left side, under the other control-box. When checking the source-code in my browser, the index.html shows a line <div class="leaflet-top leaflet-right"> - however, if I look to my saved index.html, there is no such line - it seems to be generated from somewhere else. But from where? I checked the files in css and js folders - found nothing. How can I change the position of this box?


Your question has already been asked here before.


There is a 'position' option in several elements in Leaflet like L.control to specify where in the map the element should appear.

Look in your index.html where the L.control.layers is defined and add {position: 'topleft'}

For example:

L.control.layers(layers, basemaps, {position: 'topleft'}).addTo(map);

Not the answer you're looking for? Browse other questions tagged or ask your own question.