Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
0bd17b80
Commit
0bd17b80
authored
Sep 09, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复地图后端配置管网消失问题
parent
c3c11d49
Pipeline
#59790
passed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
36 deletions
+37
-36
index.jsx
src/pages/platformCenter/gis/schemeConfig/ScopeMap/index.jsx
+37
-36
No files found.
src/pages/platformCenter/gis/schemeConfig/ScopeMap/index.jsx
View file @
0bd17b80
...
...
@@ -175,17 +175,17 @@ const Map = props => {
console
.
log
(
setttings
);
setTimeout
(()
=>
{
form
.
setFieldsValue
({
areaName
:
[
setttings
.
areaName
],
backgroundColor
:
setttings
.
backgroundColor
,
backgroundOpacity
:
setttings
.
backgroundOpacity
*
100
,
areaName
:
setttings
.
areaName
?
[
setttings
.
areaName
]
:
[
'上海市'
],
backgroundColor
:
setttings
.
backgroundColor
||
'#000000'
,
backgroundOpacity
:
setttings
.
backgroundOpacity
*
100
||
'60'
,
boundColor
:
setttings
.
boundColor
||
'#86C8F8'
,
boundWidth
:
parseInt
(
setttings
.
boundWidth
),
boundWidth
:
parseInt
(
setttings
.
boundWidth
)
||
'10'
,
extent
:
setttings
.
extent
,
schemename
:
setttings
.
schemename
,
exportScheme
:
setttings
.
exportScheme
||
'pandagis'
,
});
setColorList
(
setttings
.
boundColor
||
'#86C8F8'
);
setColor
(
setttings
.
backgroundColor
);
setColor
(
setttings
.
backgroundColor
||
'#000000'
);
setRadio
(
setttings
.
exportScheme
||
'pandagis'
);
if
(
setttings
.
id
)
{
setKeep
(
setttings
);
...
...
@@ -221,6 +221,7 @@ const Map = props => {
setMap
(
viewObject
);
const
{
layer
}
=
getPipenetLayer
(
viewObject
?.
map
);
if
(
layer
)
{
console
.
log
(
layer
);
console
.
log
(
232324234
);
layer
.
visible
=
false
;
}
...
...
@@ -235,12 +236,13 @@ const Map = props => {
});
console
.
log
(
88888
);
mapInfo
.
current
=
viewObject
;
// if (radio == 'pandagis') {
// console.log(999999);
// // 用户自定义创建的管网图
// viewObject.map.add(pandagis);
// }
console
.
log
(
radio
);
console
.
log
(
form
.
getFieldsValue
().
exportScheme
);
if
(
form
.
getFieldsValue
().
exportScheme
==
'pandagis'
)
{
console
.
log
(
999999
);
// 用户自定义创建的管网图
viewObject
.
map
.
add
(
pandagis
);
}
// gate();
};
...
...
@@ -325,36 +327,36 @@ const Map = props => {
}
});
form
.
setFieldsValue
({
areaName
:
[
setttings
.
areaName
],
backgroundColor
:
setttings
.
backgroundColor
,
backgroundOpacity
:
setttings
.
backgroundOpacity
*
100
,
areaName
:
setttings
.
areaName
?
[
setttings
.
areaName
]
:
[
'上海市'
],
backgroundColor
:
setttings
.
backgroundColor
||
'#000000'
,
backgroundOpacity
:
setttings
.
backgroundOpacity
*
100
||
'60'
,
boundColor
:
setttings
.
boundColor
||
'#86C8F8'
,
boundWidth
:
parseInt
(
setttings
.
boundWidth
),
boundWidth
:
parseInt
(
setttings
.
boundWidth
)
||
'10'
,
extent
:
setttings
.
extent
,
exportScheme
:
setttings
.
exportScheme
||
'pandagis'
,
});
setColorList
(
setttings
.
boundColor
||
'#86C8F8'
);
setColor
(
setttings
.
backgroundColor
);
setColor
(
setttings
.
backgroundColor
||
'#000000'
);
setRadio
(
setttings
.
exportScheme
||
'pandagis'
);
mapRef
.
current
.
mapchange
(
obj
);
// 清除原有接口返回后端绘制的管网图
const
{
layer
}
=
getPipenetLayer
(
mapRef
.
current
?.
map
);
if
(
layer
)
{
console
.
log
(
6666666
);
layer
.
visible
=
false
;
}
// 若方案有管网且是后端绘制每次切换首先创建用户自定义的后端绘制管网
if
(
setttings
.
exportScheme
==
'pandagis'
)
{
console
.
log
(
222222
);
const
pandagisaa
=
new
MapImageLayer
({
id
:
setttings
.
id
,
url
:
`/PandaGIS/MapServer/
${
setttings
.
id
}
`
,
layerType
:
'PipenetLayertest'
,
title
:
setttings
.
id
,
});
// 用户自定义创建的管网图
mapInfo
.
current
.
map
.
add
(
pandagisaa
);
}
//
const { layer } = getPipenetLayer(mapRef.current?.map);
//
if (layer) {
//
console.log(6666666);
//
layer.visible = false;
//
}
//
//
若方案有管网且是后端绘制每次切换首先创建用户自定义的后端绘制管网
//
if (setttings.exportScheme == 'pandagis') {
//
console.log(222222);
//
const pandagisaa = new MapImageLayer({
//
id: setttings.id,
//
url: `/PandaGIS/MapServer/${setttings.id}`,
//
layerType: 'PipenetLayertest',
//
title: setttings.id,
//
});
//
// 用户自定义创建的管网图
//
mapInfo.current.map.add(pandagisaa);
//
}
setMapsettings
(
obj
);
break
;
...
...
@@ -471,15 +473,14 @@ const Map = props => {
const
onChange
=
e
=>
{
if
(
e
.
target
.
value
==
'arcgis'
)
{
// 选择前端绘制时,如果界面有自定义的管网图就隐藏
// 选择前端绘制时,如果界面有自定义的管网图就隐藏
,打开组件自动生成前端管网图
mapInfo
.
current
.
map
.
layers
.
forEach
(
item
=>
{
if
(
item
.
layerType
&&
item
.
layerType
==
'PipenetLayertest'
)
{
console
.
log
(
444444444
);
mapInfo
.
current
.
map
.
remove
(
item
);
}
});
}
else
{
// 选择后端绘制时创建自定义的管网图
// 选择后端绘制时创建自定义的管网图
,前端管网被组件关闭自动销毁
mapInfo
.
current
.
map
.
add
(
pandagis
);
}
setRadio
(
e
.
target
.
value
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment