分类边界移除
This commit is contained in:
parent
b0524715df
commit
39b01c0667
@ -17,10 +17,7 @@
|
||||
<span>作物类型统计-高标准农田</span>
|
||||
<p>
|
||||
下载
|
||||
<img
|
||||
src="@/assets/icons/svg/downloads.svg"
|
||||
style="width: 14px; height: 14px; cursor: pointer"
|
||||
/>
|
||||
<img src="@/assets/icons/svg/downloads.svg" style="width: 14px; height: 14px; cursor: pointer" />
|
||||
</p>
|
||||
</div>
|
||||
<div ref="farmlandDiv" class="farmlandDiv"></div>
|
||||
@ -31,25 +28,12 @@
|
||||
<span>作物类型统计-行政区划</span>
|
||||
<p>
|
||||
下载
|
||||
<img
|
||||
src="@/assets/icons/svg/downloads.svg"
|
||||
style="width: 14px; height: 14px; cursor: pointer"
|
||||
/>
|
||||
<img src="@/assets/icons/svg/downloads.svg" style="width: 14px; height: 14px; cursor: pointer" />
|
||||
</p>
|
||||
</div>
|
||||
<el-select
|
||||
popper-class="select_city"
|
||||
@change="selectTab(item)"
|
||||
v-model="value"
|
||||
clearable
|
||||
placeholder="全部"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Township.arr"
|
||||
:key="item.properties.XZDM"
|
||||
:label="item.properties.XZMC"
|
||||
:value="item.properties.XZDM"
|
||||
/>
|
||||
<el-select popper-class="select_city" @change="selectTab(item)" v-model="value" clearable placeholder="全部">
|
||||
<el-option v-for="item in Township.arr" :key="item.properties.XZDM" :label="item.properties.XZMC"
|
||||
:value="item.properties.XZDM" />
|
||||
</el-select>
|
||||
<div ref="ASdivisionDiv" class="ASdivision"></div>
|
||||
</div>
|
||||
@ -59,18 +43,11 @@
|
||||
<template #title>图例</template>
|
||||
<div class="mt-4">
|
||||
<el-checkbox-group v-model="checkList" @change="change">
|
||||
<el-checkbox
|
||||
v-for="(value, item, key) in dic"
|
||||
:key="key"
|
||||
:style="{
|
||||
<el-checkbox v-for="(value, item, key) in dic" :key="key" :style="{
|
||||
background: value.color,
|
||||
border: `1px solid ${value.color}`,
|
||||
width: `100%`,
|
||||
}"
|
||||
v-model="checked3"
|
||||
:disabled="value.disabled"
|
||||
:label="item"
|
||||
/>
|
||||
}" v-model="checked3" :disabled="value.disabled" :label="item" />
|
||||
|
||||
<!-- <el-checkbox style="
|
||||
background: rgba(251, 171, 60, 1);
|
||||
@ -428,7 +405,7 @@ watch(
|
||||
);
|
||||
|
||||
// 添加wms
|
||||
function addWms(layers, customName) {
|
||||
function addWms(layers, customName, bottom) {
|
||||
let map = new Cesium.WebMapServiceImageryProvider({
|
||||
url: serverAPI.geoserverUrl + `/shuzisannong/wms?`,
|
||||
layers: layers, //图层名
|
||||
@ -441,9 +418,13 @@ function addWms(layers, customName) {
|
||||
});
|
||||
map.customName = customName; //自己定义各种属性
|
||||
let dd = viewer.imageryLayers.addImageryProvider(map); //添加图层
|
||||
if (customName.indexOf('gbznt') > -1) {
|
||||
console.log('dididididi');
|
||||
// viewer.imageryLayers.lower(dd);//将图层下移一层
|
||||
// if (customName.indexOf('gbznt') > -1) {
|
||||
// console.log('dididididi');
|
||||
// // viewer.imageryLayers.lower(dd);//将图层下移一层
|
||||
// viewer.imageryLayers.lowerToBottom(dd); //将图层移到最底层
|
||||
// viewer.imageryLayers.raise(dd); //将图层上移一层
|
||||
// }
|
||||
if (bottom) {
|
||||
viewer.imageryLayers.lowerToBottom(dd); //将图层移到最底层
|
||||
viewer.imageryLayers.raise(dd); //将图层上移一层
|
||||
}
|
||||
@ -726,6 +707,8 @@ function hiddenOverlayChart() {
|
||||
const pop = document.getElementById('popup1');
|
||||
pop.style.display = 'none'; // 清除监听事件
|
||||
viewer.scene.postRender.removeEventListener(infoWindowPostRender);
|
||||
// 移除地块高亮
|
||||
deleteEntityByName('landtype');
|
||||
}
|
||||
//显示弹窗
|
||||
function showOverlayChart(position) {
|
||||
@ -753,7 +736,17 @@ function getFarmland() {
|
||||
}
|
||||
//返回
|
||||
function back() {
|
||||
removeWms(['huangdaoqu_town'], true);
|
||||
// removeWms(['huangdaoqu_town'], true);
|
||||
// 移除高标准农田
|
||||
removeWms(['gbznt'], true);
|
||||
//
|
||||
addWms('shuzisannong:huangdaoqu_town', 'shuzisannong:huangdaoqu_town', true);
|
||||
// 重定位
|
||||
viewer.camera.flyTo({
|
||||
destination: Cesium.Rectangle.fromDegrees(119.5091, 35.5671, 120.3285, 36.1455),
|
||||
duration: 2,
|
||||
});
|
||||
flag.value = false
|
||||
}
|
||||
//接口
|
||||
const getArea = (item, index) => {
|
||||
@ -817,7 +810,7 @@ const getaArea = () => {
|
||||
|
||||
const selectTab = () => {
|
||||
areachar();
|
||||
if (value.value == '370211') {
|
||||
if (value.value == '370211') {//全部
|
||||
getTownships();
|
||||
classData = [302034, 243990, 42344, 34234, 304235];
|
||||
} else if (value.value) {
|
||||
@ -850,24 +843,37 @@ const selectTab = () => {
|
||||
data.title = [...Object.values(brr)];
|
||||
ASdivision();
|
||||
});
|
||||
const layers = viewer.imageryLayers._layers;
|
||||
for (let f = layers.length - 1; f >= 0; f--) {
|
||||
if (layers[f]._imageryProvider.aaa === 'aaa') {
|
||||
viewer.imageryLayers.remove(layers[f]);
|
||||
}
|
||||
}
|
||||
let map2 = new Cesium.WebMapServiceImageryProvider({
|
||||
url: `http://121.36.229.60:9080/geoserver/shuzisannong/wms`,
|
||||
layers: 'shuzisannong:huangdaoqu_village', //图层名
|
||||
parameters: {
|
||||
service: 'WMS',
|
||||
format: 'image/png',
|
||||
transparent: true, //是否透明
|
||||
CQL_FILTER: `XZDM=${value.value}`,
|
||||
},
|
||||
});
|
||||
map2.aaa = 'aaa';
|
||||
viewer.imageryLayers.addImageryProvider(map2);
|
||||
|
||||
|
||||
// const layers = viewer.imageryLayers._layers;
|
||||
// for (let f = layers.length - 1; f >= 0; f--) {
|
||||
// if (layers[f]._imageryProvider.aaa === 'aaa') {
|
||||
// viewer.imageryLayers.remove(layers[f]);
|
||||
// }
|
||||
// }
|
||||
// let map2 = new Cesium.WebMapServiceImageryProvider({
|
||||
// url: `http://121.36.229.60:9080/geoserver/shuzisannong/wms`,
|
||||
// layers: 'shuzisannong:huangdaoqu_village', //图层名
|
||||
// parameters: {
|
||||
// service: 'WMS',
|
||||
// format: 'image/png',
|
||||
// transparent: true, //是否透明
|
||||
// CQL_FILTER: `XZDM=${value.value}`,
|
||||
// },
|
||||
// });
|
||||
// map2.aaa = 'aaa';
|
||||
// viewer.imageryLayers.addImageryProvider(map2);
|
||||
|
||||
// 移除以前的村边界
|
||||
removeWms(['village_CQL']);
|
||||
// 移除镇高亮
|
||||
deleteEntityByName('townLine');
|
||||
// 添加新的
|
||||
addvillage(
|
||||
`XZDM=${value.value}`,
|
||||
'village_CQL'
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
//图表
|
||||
@ -1617,7 +1623,7 @@ function farmland() {
|
||||
// 图表点击事件
|
||||
function ChartClick(item) {
|
||||
console.log('item:', item);
|
||||
// 移除作物
|
||||
// 移除镇边界
|
||||
removeWms(['huangdaoqu_town'], true);
|
||||
let layername = 'shuzisannong:farmland';
|
||||
|
||||
@ -1635,7 +1641,7 @@ function ChartClick(item) {
|
||||
}
|
||||
if (!cz) {
|
||||
// 添加高标准农田服务
|
||||
addWms(layername, layername + 'gbznt');
|
||||
addWms(layername, layername + 'gbznt', true);
|
||||
}
|
||||
// 定位到地块
|
||||
let features = formLandRef.value;
|
||||
@ -2007,11 +2013,9 @@ $height: calc(100vh - 100px);
|
||||
height: 25px;
|
||||
border-radius: 20px;
|
||||
font-size: 14px;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
background: linear-gradient(180deg,
|
||||
rgba(16, 111, 111, 1) 0%,
|
||||
rgba(47, 214, 214, 1) 100%
|
||||
);
|
||||
rgba(47, 214, 214, 1) 100%);
|
||||
border: 1.5px solid rgba(23, 194, 180, 1);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@ -2288,6 +2292,7 @@ $height: calc(100vh - 100px);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.back_button {
|
||||
position: absolute;
|
||||
right: 30%;
|
||||
|
Loading…
Reference in New Issue
Block a user