Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
任超
/
js.CadastralSystem
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3163d413
authored
2020-12-31 09:35:19 +0800
by
杨威
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
设置专题树透明度
1 parent
1ebfcc8e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
src/assets/json/layerTreeData.json
src/views/systemTX/mapWeight/js/mapLayerManager.js
src/views/systemTX/mapWeight/sideTools.vue
src/assets/json/layerTreeData.json
View file @
3163d41
...
...
@@ -2,15 +2,18 @@
"label"
:
"专题树"
,
"id"
:
"1"
,
"type"
:
"layerGroup"
,
"alpha"
:
100
,
"children"
:[
{
"label"
:
"西安市阎良区"
,
"id"
:
"1-1"
,
"type"
:
"layerGroup"
,
"alpha"
:
100
,
"children"
:[{
"label"
:
"行政区划"
,
"id"
:
"1-1-1"
,
"type"
:
"layerGroup"
,
"alpha"
:
100
,
"children"
:[
{
"label"
:
"行政区界限"
,
...
...
@@ -32,6 +35,7 @@
"label"
:
"地籍分区"
,
"id"
:
"1-1-2"
,
"type"
:
"layerGroup"
,
"alpha"
:
100
,
"children"
:[
{
"label"
:
"地籍区"
,
...
...
@@ -53,6 +57,7 @@
"label"
:
"不动产单元"
,
"id"
:
"1-1-3"
,
"type"
:
"layerGroup"
,
"alpha"
:
100
,
"children"
:[
{
"label"
:
"线状定着物"
,
...
...
@@ -130,6 +135,7 @@
"label"
:
"自然地理"
,
"id"
:
"1-1-4"
,
"type"
:
"layerGroup"
,
"alpha"
:
100
,
"children"
:[
{
"label"
:
"辅助面"
,
...
...
src/views/systemTX/mapWeight/js/mapLayerManager.js
View file @
3163d41
...
...
@@ -157,6 +157,17 @@ export default {
}
}
layer
.
sublayers
=
items
;
},
//设置图层透明度
setLayerOpacity
(
viewId
,
layers
,
value
){
var
view
=
maps
[
viewId
],
layer
=
view
.
map
.
findLayerById
(
"testLayer"
);
for
(
var
i
=
0
;
i
<
layers
.
length
;
i
++
){
var
sublayer
=
layer
.
findSublayerById
(
layers
[
i
].
layerId
);
if
(
sublayer
){
sublayer
.
opacity
=
value
/
100
;
}
}
}
}
}
\ No newline at end of file
...
...
src/views/systemTX/mapWeight/sideTools.vue
View file @
3163d41
...
...
@@ -31,7 +31,7 @@
<span
class=
"custom-tree-node"
slot-scope=
"
{ node, data }">
<span>
{{
node
.
label
}}
</span>
<span
class=
"setOpacity"
v-if=
"data.type == 'layerGroup'"
>
<el-slider
v-model=
"data.alpha"
ref=
"data.id"
:format-tooltip=
"formatTooltip"
@
change=
"alphaChange(data)"
></el-slider>
<el-slider
v-model=
"data.alpha"
ref=
"data.id"
:format-tooltip=
"formatTooltip"
@
change=
"alphaChange(data)"
></el-slider>
</span>
</span>
</el-tree>
...
...
@@ -114,7 +114,12 @@
return
val
+
"%"
;
},
alphaChange
(
nodeData
){
if
(
nodeData
.
alpha
==
0
){
return
;
}
var
ids
=
[];
this
.
getChildrens
(
nodeData
,
ids
);
this
.
setLayerOpacity
(
this
.
viewId
,
ids
,
nodeData
.
alpha
);
}
}
}
...
...
Please
register
or
sign in
to post a comment