File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ import Thumb from "model/thumb";
28
28
29
29
export default {
30
30
name: ' PPagePlaces' ,
31
+ props: {
32
+ staticFilter: {
33
+ type: Object ,
34
+ default : () => {
35
+ },
36
+ },
37
+ },
31
38
data () {
32
39
return {
33
40
initialized: false ,
@@ -37,6 +44,7 @@ export default {
37
44
loading: false ,
38
45
url: " " ,
39
46
attribution: ' <a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>' ,
47
+ maxCount: 500000 ,
40
48
options: {},
41
49
mapFont: [],
42
50
result: {},
@@ -245,6 +253,20 @@ export default {
245
253
}
246
254
}
247
255
},
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
+ },
248
270
search () {
249
271
if (this .loading ) return ;
250
272
@@ -256,10 +278,12 @@ export default {
256
278
257
279
this .updateQuery ();
258
280
281
+ // Compose query params.
259
282
const options = {
260
- params: this .filter ,
283
+ params: this .searchParams () ,
261
284
};
262
285
286
+ // Fetch results from server.
263
287
return Api .get (" geo" , options).then ((response ) => {
264
288
if (! response .data .features || response .data .features .length === 0 ) {
265
289
this .loading = false ;
You can’t perform that action at this time.
0 commit comments