mirror of
https://github.com/bellingcat/osm-search.git
synced 2026-06-08 03:28:33 +03:00
Add backend size limits on query area/execution time
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
<title>Bellingcat OpenStreetMap search</title>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
|
||||
<script defer data-domain="osm.baarle-hertog.xyz" src="https://plausible.io/js/script.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
|
||||
@@ -101,7 +101,12 @@ export default new Vuex.Store({
|
||||
},
|
||||
}
|
||||
)
|
||||
.then((d) => d.json())
|
||||
.then((d) => {
|
||||
if (d.status != 200) {
|
||||
return Promise.reject(Error(d.status));
|
||||
}
|
||||
return d.json();
|
||||
})
|
||||
.then((data) => {
|
||||
let time2 = performance.now();
|
||||
commit("setResponseTime", time2 - time1);
|
||||
@@ -109,12 +114,21 @@ export default new Vuex.Store({
|
||||
commit("setLoading", false);
|
||||
commit("setError", false);
|
||||
})
|
||||
.catch(() => {
|
||||
.catch((e) => {
|
||||
commit("setLoading", false);
|
||||
commit(
|
||||
"setError",
|
||||
"Search error. Check your custom features or email logan@bellingcat.com."
|
||||
);
|
||||
if (e.message == 400) {
|
||||
commit("setLoading", false);
|
||||
commit(
|
||||
"setError",
|
||||
"Your search area is too large, or your search timed out. Zoom in on a smaller area or change your search parameters. Adding a point feature (green) will increase speed."
|
||||
);
|
||||
} else {
|
||||
commit("setLoading", false);
|
||||
commit(
|
||||
"setError",
|
||||
"Search error. Check your custom features or email logan@bellingcat.com."
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user