Skip to content

Commit 49e9232

Browse files
committed
Places: Limit the number of images displayed on the map to 500,000
1 parent 49b58f3 commit 49e9232

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

frontend/src/pages/places.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ import Thumb from "model/thumb";
2828
2929
export default {
3030
name: 'PPagePlaces',
31+
props: {
32+
staticFilter: {
33+
type: Object,
34+
default: () => {
35+
},
36+
},
37+
},
3138
data() {
3239
return {
3340
initialized: false,
@@ -37,6 +44,7 @@ export default {
3744
loading: false,
3845
url: "",
3946
attribution: '<a href="https://www.maptiler.com/copyright/" target="_blank">&copy; MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap contributors</a>',
47+
maxCount: 500000,
4048
options: {},
4149
mapFont: [],
4250
result: {},
@@ -245,6 +253,20 @@ export default {
245253
}
246254
}
247255
},
256+
searchParams() {
257+
const params = {
258+
count: this.maxCount,
259+
offset: 0,
260+
};
261+
262+
Object.assign(params, this.filter);
263+
264+
if (this.staticFilter) {
265+
Object.assign(params, this.staticFilter);
266+
}
267+
268+
return params;
269+
},
248270
search() {
249271
if (this.loading) return;
250272
@@ -256,10 +278,12 @@ export default {
256278
257279
this.updateQuery();
258280
281+
// Compose query params.
259282
const options = {
260-
params: this.filter,
283+
params: this.searchParams(),
261284
};
262285
286+
// Fetch results from server.
263287
return Api.get("geo", options).then((response) => {
264288
if (!response.data.features || response.data.features.length === 0) {
265289
this.loading = false;

0 commit comments

Comments
 (0)