Commit d280daa4 authored by 皮倩雯's avatar 皮倩雯

地图管网bug显示异常修复

parent e4ea9af9
Pipeline #59866 passed with stages
......@@ -220,40 +220,42 @@ const Map = props => {
const getMapInfo = viewObject => {
setMap(viewObject);
const { layer } = getPipenetLayer(viewObject?.map);
if (layer) {
console.log(layer);
console.log(232324234);
layer.visible = false;
}
console.log(layer);
// if (layer) {
// console.log(923423);
// layer.visible = false;
// }
watchUtils.watch(viewObject, ['zoom'], newzoom => {
// 鼠标滚动隐藏前端绘制的管网图
// 鼠标滚动隐藏管网图
viewObject.map.layers.find(layer => {
console.log(layer);
if (layer.layerType == 'PipenetLayer') {
console.log(11111111);
console.log(32423);
layer.visible = false;
}
});
});
mapInfo.current = viewObject;
console.log(radio);
console.log(form.getFieldsValue().exportScheme);
if (form.getFieldsValue().exportScheme == 'pandagis') {
console.log(999999);
// 用户自定义创建的管网图
viewObject.map.add(pandagis);
mapInfo.current.map.layers.forEach(item => {
console.log(item);
console.log(item.layerType);
if (item.layerType && item.layerType != 'PipenetLayertest') {
// 用户自定义创建的管网图
console.log(123123);
viewObject.map.add(pandagis);
}
});
}
gate();
};
const gate = () => {
console.log(form.getFieldsValue().schemename);
console.log(setttingsSave);
let aa = form.getFieldsValue().schemename;
setttingsSave.forEach(item => {
if (item.schemename === aa) {
if (!item.areaName) {
console.log(123);
mapRef.current.changeAreaName('上海市');
}
// if (!item.backgroundColor) {
......@@ -412,7 +414,6 @@ const Map = props => {
} else {
list = obj.boundColor;
}
console.log(obj);
const jsConfig = {
extent: form.getFieldValue('extent'),
areaName: aa,
......@@ -471,10 +472,18 @@ const Map = props => {
});
const onChange = e => {
console.log(e.target.value);
const { layer } = getPipenetLayer(mapInfo.current?.map);
console.log(layer);
if (layer) {
console.log(923423);
layer.visible = false;
}
if (e.target.value == 'arcgis') {
// 选择前端绘制时,如果界面有自定义的管网图就隐藏,打开组件自动生成前端管网图
mapInfo.current.map.layers.forEach(item => {
if (item.layerType && item.layerType == 'PipenetLayertest') {
console.log(123);
mapInfo.current.map.remove(item);
}
});
......@@ -491,7 +500,6 @@ const Map = props => {
// 颜色选择
const colorChange = value => {
console.log(value);
setColorList(value.hex);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment