0

I have used the qgis2web plugin successfully before but now my exported maps all have a fixed canvas size that is larger than the display screen.

Here is the Head section of my HTML file as I suspect it is here where the problem is:

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <link rel="stylesheet" href="css/leaflet.css">
    <link rel="stylesheet" href="css/qgis2web.css"><link rel="stylesheet" href="css/fontawesome-all.min.css">
    <style>
    #map {
        width: 1617px;
        height: 834px;
    }
    </style>
    <title></title>
</head>

What is setting the "width: 1617px; height: 834px;" statement?

Thanks.

1 Answer 1

2

This is because you are exporting using the "canvas-size" template which comes as default with qgis2web. This exports your map to be the size of your visible QGIS project canvas. If you make your QGIS window narrower, the exported map will be narrower.

The other default template is "full-screen". This instead makes the exported map fill the browser window.

You can select which template to use in the qgis2web dialog by clicking on the "Appearance" tab, and using the "Template" drop-down.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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