diff --git a/src/services/map-service.js b/src/services/map-service.js index e3a1885ba046e388c2d0b7574b2f8249c8db20f2..a95e3852918adbb354b98f81921e35f45ca1b1be 100644 --- a/src/services/map-service.js +++ b/src/services/map-service.js @@ -400,7 +400,7 @@ const mapService = { return { color, opacity }; }, - addVectorTileLayer: function (url, projectId, featureTypes, formFilters, queryParams) { + addVectorTileLayer: function ({ url, projectId, featureTypes, formFilters = {}, queryParams = {} }) { const format_cfg = {/*featureClass: Feature*/ }; const mvt = new MVT(format_cfg); const options = { diff --git a/src/views/Project/FeaturesListAndMap.vue b/src/views/Project/FeaturesListAndMap.vue index fcba7ab056e2e2002d023cc8dfc029e02016aca3..0c65860caac883ff570007b471d8f18345579758 100644 --- a/src/views/Project/FeaturesListAndMap.vue +++ b/src/views/Project/FeaturesListAndMap.vue @@ -343,13 +343,13 @@ export default { this.$nextTick(() => { const project_id = this.projectSlug.split('-')[0]; const mvtUrl = `${this.API_BASE_URL}features.mvt`; - mapService.addVectorTileLayer( - mvtUrl, - project_id, - this.feature_types, - this.form, - this.queryparams, - ); + mapService.addVectorTileLayer({ + url: mvtUrl, + projectId: project_id, + featureTypes: this.feature_types, + formFilters: this.form, + queryParams: this.queryparams, + }); }); this.fetchPagedFeatures(); diff --git a/src/views/Project/ProjectDetail.vue b/src/views/Project/ProjectDetail.vue index 1275428c247cd28306132d5346f8548a02c23070..7867a7f1a27740345a4e596fdd0a6a63fcf75cf6 100644 --- a/src/views/Project/ProjectDetail.vue +++ b/src/views/Project/ProjectDetail.vue @@ -435,15 +435,16 @@ export default { this.checkForOfflineFeature(); const project_id = this.$route.params.slug.split('-')[0]; const mvtUrl = `${this.API_BASE_URL}features.mvt`; - mapService.addVectorTileLayer( - mvtUrl, - project_id, - this.feature_types, - { + mapService.addVectorTileLayer({ + url: mvtUrl, + projectId: project_id, + featureTypes: this.feature_types, + queryParams: { ordering: this.project.feature_browsing_default_sort, filter: this.project.feature_browsing_default_filter, } - ); + }); + this.mapLoading = false; this.arraysOffline.forEach((x) => (x.geojson.properties.color = 'red')); const featuresOffline = this.arraysOffline.map((x) => x.geojson);