diff --git a/src/views/contracted/village/map/map.vue b/src/views/contracted/village/map/map.vue index 7fa68b58..725ddeb0 100644 --- a/src/views/contracted/village/map/map.vue +++ b/src/views/contracted/village/map/map.vue @@ -19,12 +19,12 @@

图例

- -

承包地

-

自留地

-

机动地

-

开荒地

-

其他地

+ +

承包地

+

自留地

+

机动地

+

开荒地

+

其他地

@@ -182,7 +182,6 @@ name: "contractedVillageContractor", data() { return { - result: [], form: {}, // 地块信息表单参数 map: "", // 地图 mapGeoServerUrl: "", // geoserver地址 @@ -215,6 +214,7 @@ showDeleteBtn: false, // 控制删除按钮的显示隐藏 isDisabled: false, // 是否禁用 taskStatus: null, // 调查任务的完成状态:1表示已完成,2表示未完成 + landCategory: ['10'], // 地块类别 }; }, created() { @@ -418,6 +418,13 @@ }); }); }, + filterLandLayer() { + if (this.landLayer) { + this.map.removeLayer(this.landLayer); + this.landLayer = ""; + } + this.addLandLayer(); + }, // 添加地块图层 addLandLayer() { this.landLayer = new ol.layer.Image({ @@ -425,7 +432,7 @@ url: this.mapGeoServerUrl + '/wms', params: { LAYERS: this.landLayerName, - cql_filter: "dept_id = '" + this.$route.query.deptId + "'", + cql_filter: "dept_id = '" + this.$route.query.deptId + "' and DKLB in (" + this.landCategory + ")", SRID: 3857, abc: Math.random() // 无效参数,保证每次发送的请求都不一样 }