Commit f236419f authored by xuchaozou's avatar xuchaozou

fix: 修复后端出图错误

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