mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:37:07 +00:00
Show an error if a layer is too large.
The map view limits the size of layers (both user and regular) in order to keep the system responsive, as Leaflet is not great at handling large layers.
This commit is contained in:
@@ -475,7 +475,7 @@ export default {
|
||||
bounds._northEast.lng,
|
||||
bounds._northEast.lat
|
||||
].map(i => i.toFixed(bboxScale)).join(",");
|
||||
const limit = 10000;
|
||||
const limit = 10000; // Empirical value
|
||||
|
||||
const query = new URLSearchParams({bbox, limit});
|
||||
|
||||
@@ -521,7 +521,9 @@ export default {
|
||||
|
||||
l.layer.lastRequestURL = url;
|
||||
} else {
|
||||
console.warn("Too much data from", url);
|
||||
console.warn(`Too much data from ${url} (${layer.features.length ?? layer.length} ≥ ${limit} features)`);
|
||||
|
||||
this.showSnack([`Layer ‘${l.layer.options.userLayerName}’ is too large: ${layer.features.length ?? layer.length} features; maximum is ${limit}`, "error"]);
|
||||
}
|
||||
})
|
||||
.finally( () => {
|
||||
@@ -783,7 +785,7 @@ export default {
|
||||
this.addUserLayers(userLayers);
|
||||
},
|
||||
|
||||
...mapActions(["api"])
|
||||
...mapActions(["api", "showSnack"])
|
||||
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user