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

地图管网bug显示异常修复

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