1

I try to change the position of the title created by qgis2web to the top left above the zoom control. Right now it is always displayed on the top right side.

And is it somehow possible to make these changes just in the qgis2web template file?

1

Open the exported index.html file in a text editor. Find the line:

var title = new L.Control();

Change it to:

var title = new L.Control({position: 'topleft'});

Note that this will be affected by the default position of the zoom controls. To move the title above the zoom controls, first find the following code:

var map = L.map('map', {
    zoomControl:true, maxZoom:

Remove zoomControl: true,:

var map = L.map('map', {
    maxZoom:

Next, find this code:

title.addTo(map);

Add to it as follows:

title.addTo(map);
L.control.zoom().addTo(map);
  • Thanks for the answer! Is it possible to display the title above the zoom control just by editing the qgis2web template? – gHupf May 22 '18 at 13:11
  • Not just by editing the template, no. I'll edit my answer to describe how to get the title above the zoom controls. – Tom Chadwin May 22 '18 at 13:46
  • Perfect, thanks! I edited my question to fit the answer. – gHupf May 22 '18 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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