Commit f236419f authored by xuchaozou's avatar xuchaozou

fix: 修复后端出图错误

parent 2789b7be
Pipeline #92404 failed with stages
...@@ -95,8 +95,8 @@ ...@@ -95,8 +95,8 @@
"@wisdom-cesium/cesium": "1.1.12", "@wisdom-cesium/cesium": "1.1.12",
"@wisdom-cesium/krpano": "^1.0.29-60", "@wisdom-cesium/krpano": "^1.0.29-60",
"@wisdom-map/amap":"^2.0.15", "@wisdom-map/amap":"^2.0.15",
"@wisdom-map/arcgismap":"^2.0.58", "@wisdom-map/arcgismap":"^2.0.61",
"@wisdom-map/basemap":"^2.0.2", "@wisdom-map/basemap":"^2.0.3",
"@wisdom-utils/components": "0.1.337", "@wisdom-utils/components": "0.1.337",
"@wisdom-utils/utils": "0.1.377", "@wisdom-utils/utils": "0.1.377",
"ace-builds": "^1.4.12", "ace-builds": "^1.4.12",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* eslint-disable no-case-declarations */ /* eslint-disable no-case-declarations */
/* eslint-disable import/no-duplicates */ /* eslint-disable import/no-duplicates */
/* eslint-disable no-new */ /* eslint-disable no-new */
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState, useRef, useMemo } from 'react';
import { SketchPicker } from 'react-color'; import { SketchPicker } from 'react-color';
import { import {
ArcGISMap, ArcGISMap,
...@@ -18,6 +18,7 @@ import { ...@@ -18,6 +18,7 @@ import {
SimpleFillSymbol, SimpleFillSymbol,
Graphic, Graphic,
EditAndDrawPanel, EditAndDrawPanel,
Handles
} from '@wisdom-map/arcgismap'; } from '@wisdom-map/arcgismap';
import { checkInternalNetwork } from '@/utils/utils'; import { checkInternalNetwork } from '@/utils/utils';
import { getPipenetLayer } from '@wisdom-map/basemap'; import { getPipenetLayer } from '@wisdom-map/basemap';
...@@ -200,6 +201,7 @@ const Map = props => { ...@@ -200,6 +201,7 @@ const Map = props => {
const [hide, setHide] = useState(false); const [hide, setHide] = useState(false);
const [hideChange, setHideChange] = useState(null); const [hideChange, setHideChange] = useState(null);
const [keepNameCustomPointExtent, setKeepNameCustomPointExtent] = useState(''); // 保存方案初始自定义区域 const [keepNameCustomPointExtent, setKeepNameCustomPointExtent] = useState(''); // 保存方案初始自定义区域
const mapHandles = useRef(new Handles())
useEffect(() => { useEffect(() => {
GetWebSiteConfig({ client: 'sandbox' }) GetWebSiteConfig({ client: 'sandbox' })
...@@ -495,14 +497,6 @@ const Map = props => { ...@@ -495,14 +497,6 @@ const Map = props => {
} }
}); });
setMap(viewObject); setMap(viewObject);
watchUtils.watch(viewObject, ['zoom'], newzoom => {
// 鼠标滚动隐藏管网图
viewObject.map.layers.find(layer => {
if (layer.layerType == 'PipenetLayer') {
layer.visible = false;
}
});
});
mapInfo.current = viewObject; mapInfo.current = viewObject;
if (form.getFieldsValue().exportScheme == 'pandagis') { if (form.getFieldsValue().exportScheme == 'pandagis') {
let data = mapInfo.current.map.layers.find( let data = mapInfo.current.map.layers.find(
...@@ -521,6 +515,7 @@ const Map = props => { ...@@ -521,6 +515,7 @@ const Map = props => {
url: `/PandaGIS/MapServer/${aa}`, url: `/PandaGIS/MapServer/${aa}`,
layerType: 'PipenetLayertest', layerType: 'PipenetLayertest',
title: aa, title: aa,
customParameters : {}
}); });
viewObject.map.add(pandagis1); viewObject.map.add(pandagis1);
} }
...@@ -720,7 +715,14 @@ const Map = props => { ...@@ -720,7 +715,14 @@ const Map = props => {
setColorList(setttings.boundColor || '#86C8F8'); setColorList(setttings.boundColor || '#86C8F8');
setKeepColor(setttings.boundColor || '#86C8F8'); setKeepColor(setttings.boundColor || '#86C8F8');
setColor(setttings.backgroundColor || '#000000'); setColor(setttings.backgroundColor || '#000000');
setRadio(setttings.exportScheme || 'pandagis'); if(radio == "arcgis" && setttings.exportScheme == "arcgis") {
setRadio()
setTimeout(() => {
setRadio("arcgis")
}, 50)
} else {
setRadio(setttings.exportScheme || 'pandagis');
}
setRadio1(setttings.customFlag); setRadio1(setttings.customFlag);
mapRef.current.mapchange(obj); mapRef.current.mapchange(obj);
...@@ -760,6 +762,25 @@ const Map = props => { ...@@ -760,6 +762,25 @@ const Map = props => {
}, 0); }, 0);
}; };
useEffect(() => {
if(!map) return
const viewObject = map
if(mapHandles.current) {
mapHandles.current.removeAll()
mapHandles.current.add(watchUtils.watch(viewObject, ['zoom'], newzoom => {
// 鼠标滚动隐藏管网图
viewObject.map.layers.find(layer => {
if (layer.layerType == 'PipenetLayer') {
layer.visible = false;
}
});
}))
}
return () => {
mapHandles.current && mapHandles.current.removeAll()
}
}, [map])
useEffect(() => { useEffect(() => {
if (name && !hide) { if (name && !hide) {
setHideChange(false); setHideChange(false);
...@@ -939,12 +960,13 @@ const Map = props => { ...@@ -939,12 +960,13 @@ const Map = props => {
}); });
}; };
const pandagis = new MapImageLayer({ const pandagis = useMemo(() => new MapImageLayer({
id: keep.id, id: keep.id,
url: `/PandaGIS/MapServer/${keep.id}`, url: `/PandaGIS/MapServer/${keep.id}`,
layerType: 'PipenetLayertest', layerType: 'PipenetLayertest',
title: keep.id, title: keep.id,
}); customParameters : {}
}), [keep])
const onChange = e => { const onChange = e => {
const { layer } = getPipenetLayer(mapInfo.current?.map); const { layer } = getPipenetLayer(mapInfo.current?.map);
...@@ -1339,7 +1361,7 @@ const Map = props => { ...@@ -1339,7 +1361,7 @@ const Map = props => {
client="sandbox" client="sandbox"
/> />
)} )}
{radio == 'arcgis' ? ( {radio == 'arcgis' && map && name && Schemename? (
<PipenetStylesCenter <PipenetStylesCenter
schemeName={Schemename.schemename} schemeName={Schemename.schemename}
mapServerName={name} mapServerName={name}
......
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