fix(): 继续修复图层问题
parent
a187c6fec3
commit
a2b0d00cfb
|
|
@ -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 === '沿河居民户' ? <YHJMH /> : null}
|
||||
|
||||
{checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户' ? <SetWxqStation /> : null}
|
||||
{checkedObj.label === '搜索结果' ? <SetDrpStation tms={tms} setTableData={()=>{}} /> : null}
|
||||
|
||||
{checkedObj.label === '搜索结果' ? <SetDrpStation tms={tms} setTableData={() => { }} /> : null}
|
||||
|
||||
</div>
|
||||
: null
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue