What I have:
QGIS 3.18 on Win 10 containing a project with:
- OpenStreetMap basemap
- Point layer (Geopackage, 5.1 MB), representing centroids of buildings of a city
- Point layer set to scale based visibility (only visible when zoomed in for more than 1:5000, corresponds to canvas extent of ca. 1km*1km and smaller) - so normally, just a few hundred (at max. ca. 1400) points are visible due to small canvas extent.
Point layer consists of:
- 54.000 features, extent ca. 12*12 km
- Attributes contain two fields:
fid
and an additional integer field
What I want to do:
I want to make the project available as WebMap with qgis2web
plugin, ver. 3.16. This works fine for other projects.
What the problem is:
The exported map loads extremely slow and the browser becomes unresponsive. The same is true for the plugin's preview. I get the warning:
A large number of features are present in the map. Generating the preview may take some time.
I guess this is because it tries to load all 54.000 point features, even if only a small section of the whole extent is inside the current canvas extent. Scale based visibility apparently can't be converted by qgis2web plugin.
What I tried:
Changing the precision
setting in the plugin, but with no success. I also looked to the other settings of the plugin (check the cluster
checkbox for the point layer), but they don't resolve the problem.
I also tried splitting up the layer to several small layers, based on a grid. The problem persists. I guess that Leaflet/the Web site still tries to load all layers in the current canvas extent - so the site gets blocked before you even get the chance to zoom in.
The question:
How can this problem be solved so that I have a WebMap with OSM basemap + the point layer, loading in reasonable time (few seconds at max.)
Screenshots: