diff --git a/src/views/Home/homePanelsLayoutPage/index.js b/src/views/Home/homePanelsLayoutPage/index.js
index 7b08de6da..12de0025a 100644
--- a/src/views/Home/homePanelsLayoutPage/index.js
+++ b/src/views/Home/homePanelsLayoutPage/index.js
@@ -421,12 +421,12 @@ const HomePage = ({ showPanels }) => {
// 先清除已存在的同名图层
mapObj && mapObj.getLayers().getArray().forEach(layer => {
if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 ||
- layer.values_.name.indexOf('ZHZS_YQ') > -1 ||
- layer.values_.name.indexOf('ZHZS_YQ_DRP') > -1)) {
- mapObj.removeLayer(layer);
+ layer.values_.name.indexOf('ZHZS_YQ') > -1 ||
+ layer.values_.name.indexOf('ZHZS_YQ_DRP') > -1)) {
+ layer.getSource().clear()
}
});
- debugger
+
// 根据类型确定弹窗类型和图层
let popType = item.type;
let layerToShow = {};
@@ -547,11 +547,11 @@ const HomePage = ({ showPanels }) => {
}));
// 清除已存在的同名图层
- mapObj && mapObj.getLayers().getArray().forEach(layer => {
- if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_YQ') > -1)) {
- mapObj.removeLayer(layer);
- }
- });
+ // mapObj && mapObj.getLayers().getArray().forEach(layer => {
+ // if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_YQ') > -1)) {
+ // mapObj.removeLayer(layer);
+ // }
+ // });
// 创建雨量站图层
addRainLayer(list, tms)
} catch (error) {
@@ -627,8 +627,8 @@ const HomePage = ({ showPanels }) => {
setSearchVal('')
dispatch.runtime.closeFeaturePopAll()
mapObj && mapObj.getLayers().getArray().forEach(layer => {
- if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1||layer.values_.name.indexOf('ZHZS_YQ') > -1)) {
- mapObj.removeLayer(layer);
+ if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ_DRP') > -1)) {
+ layer.getSource().clear()
}
});
dispatch.runtime.setHome()
@@ -680,8 +680,8 @@ const HomePage = ({ showPanels }) => {
setCheckedObj(item)
setShowTable(true)
mapObj && mapObj.getLayers().getArray().forEach(layer => {
- if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 ||layer.values_.name.indexOf('ZHZS_YQ') > -1)) {
- mapObj.removeLayer(layer);
+ if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ_DRP') > -1)) {
+ layer.getSource().clear()
}
});
dispatch.runtime.setHome()
@@ -764,8 +764,8 @@ const HomePage = ({ showPanels }) => {
{checkedObj.label === '沿河居民户' ? : null}
{checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户' ? : null}
- {checkedObj.label === '搜索结果' ? {}} /> : null}
-
+ {checkedObj.label === '搜索结果' ? { }} /> : null}
+
: null
}