Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
刘远
/
3d_dc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
386e0a84
authored
2020-08-14 15:53:34 +0800
by
刘远
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
2 parents
848b8988
c1cc48da
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
110 additions
and
91 deletions
src/assets/js/map/flood.js
src/assets/js/map/heightControl.js
src/assets/js/map/viewpoint.js
src/assets/js/map/visual.js
src/components/allSee.vue
src/components/kgAnalusis.vue
src/components/tjxAnslysis.vue
src/components/visualField.vue
src/components/ymAnslysis.vue
src/views/Home.vue
src/assets/js/map/flood.js
View file @
386e0a8
...
...
@@ -4,20 +4,14 @@ export default class flood {
this
.
positions2d
=
[];
this
.
handlerPolygon
=
new
Cesium
.
DrawHandler
(
objectManage
.
viewer
,
Cesium
.
DrawMode
.
Polygon
);
this
.
handlerPolygon
.
drawEvt
.
addEventListener
(
polygon
=>
{
var
array
=
[].
concat
(
polygon
.
object
.
positions
)
,
positions
=
[]
;
var
array
=
[].
concat
(
polygon
.
object
.
positions
);
for
(
var
i
=
0
,
len
=
array
.
length
;
i
<
len
;
i
++
){
var
cartographic
=
Cesium
.
Cartographic
.
fromCartesian
(
array
[
i
]);
var
longitude
=
Cesium
.
Math
.
toDegrees
(
cartographic
.
longitude
);
var
latitude
=
Cesium
.
Math
.
toDegrees
(
cartographic
.
latitude
);
var
h
=
cartographic
.
height
;
if
(
positions
.
indexOf
(
longitude
)
===-
1
&&
positions
.
indexOf
(
latitude
)
===-
1
){
positions
.
push
(
longitude
);
positions
.
push
(
latitude
);
positions
.
push
(
h
);
this
.
positions2d
.
push
(
longitude
);
this
.
positions2d
.
push
(
latitude
);
this
.
positions2d
.
push
(
1000.0
);
}
this
.
positions2d
.
push
(
longitude
);
this
.
positions2d
.
push
(
latitude
);
this
.
positions2d
.
push
(
cartographic
.
height
);
}
});
}
...
...
@@ -70,11 +64,19 @@ export default class flood {
}
});
}
floodParse
(
scene
,
positions2d
,
waterHeight
,
targetHeight
)
{
var
River1
=
new
Cesium
.
Primitive
({
floodParse
(
waterHeight
,
targetHeight
)
{
!
this
.
positions2d
.
length
&&
(
this
.
positions2d
=
[
116.44391163897568
,
39.922128887755996
,
10
,
116.47222524452756
,
39.921663337343915
,
10
,
116.47147655687662
,
39.903608069115315
,
10
,
116.44520545789665
,
39.902556426686864
,
10
,
116.44515353439972
,
39.90683243165845
,
10
,
116.4437677267605
,
39.9069642145195
,
10
]);
this
.
river
=
new
Cesium
.
Primitive
({
geometryInstances
:
new
Cesium
.
GeometryInstance
({
geometry
:
new
Cesium
.
PolygonGeometry
({
polygonHierarchy
:
new
Cesium
.
PolygonHierarchy
(
Cesium
.
Cartesian3
.
fromDegreesArrayHeights
(
positions2d
)),
polygonHierarchy
:
new
Cesium
.
PolygonHierarchy
(
Cesium
.
Cartesian3
.
fromDegreesArrayHeights
(
this
.
positions2d
)),
extrudedHeight
:
targetHeight
,
height
:
waterHeight
,
vertexFormat
:
Cesium
.
EllipsoidSurfaceAppearance
.
VERTEX_FORMAT
...
...
@@ -96,6 +98,10 @@ export default class flood {
}),
show
:
true
});
scene
.
primitives
.
add
(
River1
);
objectManage
.
viewer
.
scene
.
primitives
.
add
(
this
.
river
);
}
remove
()
{
this
.
positions2d
=
[];
objectManage
.
viewer
.
scene
.
primitives
.
remove
(
this
.
river
);
}
}
\ No newline at end of file
...
...
src/assets/js/map/heightControl.js
View file @
386e0a8
import
objectManage
from
'./maputils'
;
export
default
class
heightControl
{
constructor
()
{
constructor
(
opt
)
{
this
.
handlerPolygon
=
new
Cesium
.
DrawHandler
(
objectManage
.
viewer
,
Cesium
.
DrawMode
.
Polygon
);
this
.
building
=
objectManage
.
viewer
.
scene
.
layers
.
find
(
"build1"
);
this
.
building1
=
objectManage
.
viewer
.
scene
.
layers
.
find
(
"build2"
);
this
.
arr
=
[];
var
i
=
0
;
while
(
i
<
2000
)
this
.
arr
.
push
(
i
++
);
this
.
handlerPolygon
.
drawEvt
.
addEventListener
(
result
=>
{
var
array
=
[].
concat
(
result
.
object
.
positions
),
positions
=
[];
var
polygon
=
result
.
object
;
...
...
@@ -17,16 +22,37 @@ export default class heightControl {
positions
.
push
(
latitude
);
}
}
this
.
polygon
=
objectManage
.
viewer
.
entities
.
add
({
id
:
'polygonA'
,
polygon
:
{
hierarchy
:
Cesium
.
Cartesian3
.
fromDegreesArray
(
positions
),
height
:
105
,
material
:
new
Cesium
.
Color
(
1
,
1
,
0.20
,
0.5
),
outline
:
true
,
outlineColor
:
Cesium
.
Color
.
RED
}
}).
polygon
;
this
.
addPolygon
(
Object
.
assign
(
opt
,
{
p
:
positions
}));
this
.
splice
(
opt
.
h
);
});
}
addPolygon
(
opt
)
{
this
.
polygon
=
objectManage
.
viewer
.
entities
.
add
({
id
:
'polygonA'
,
polygon
:
{
hierarchy
:
Cesium
.
Cartesian3
.
fromDegreesArray
(
opt
.
p
),
height
:
opt
.
h
,
material
:
new
Cesium
.
Color
(
1
,
1
,
0.20
,
0.5
),
outline
:
true
,
outlineColor
:
Cesium
.
Color
.
RED
}
}).
polygon
;
}
splice
(
h
)
{
this
.
building
.
clipLineColor
=
Cesium
.
Color
.
WHITE
.
withAlpha
(
0.0
);
this
.
building1
.
setObjsColor
(
this
.
arr
,
Cesium
.
Color
.
DARKORANGE
.
withAlpha
(
0.5
));
this
.
building
.
setCustomClipBox
({
dimensions
:
new
Cesium
.
Cartesian3
(
5000
,
5000
,
h
*
2
),
position
:
Cesium
.
Cartesian3
.
fromDegrees
(
116.44391163897568
,
39.922128887755996
,
h
/
h
-
1
),
clipMode
:
"clip_behind_any_plane"
});
this
.
building1
.
setCustomClipBox
({
dimensions
:
new
Cesium
.
Cartesian3
(
5000
,
5000
,
h
*
2
),
position
:
Cesium
.
Cartesian3
.
fromDegrees
(
116.44391163897568
,
39.922128887755996
,
h
/
h
-
1
),
clipMode
:
"clip_behind_all_plane"
});
}
remove
()
{
objectManage
.
viewer
.
entities
.
removeAll
();
}
}
\ No newline at end of file
...
...
src/assets/js/map/viewpoint.js
View file @
386e0a8
import
objectManage
from
'./maputils'
;
export
default
class
viewpoint
{
constructor
()
{
...
...
@@ -39,4 +38,10 @@ export default class viewpoint {
objectManage
.
viewer
.
scene
.
viewFlag
=
false
;
this
.
handlerPoint
.
activate
();
}
remove
()
{
this
.
sightline
.
destroy
();
this
.
sightline
=
new
Cesium
.
Sightline
(
objectManage
.
viewer
.
scene
);
this
.
sightline
.
couldRemove
=
false
;
this
.
sightline
.
build
();
}
}
\ No newline at end of file
...
...
src/assets/js/map/visual.js
View file @
386e0a8
...
...
@@ -64,7 +64,6 @@ export default class visual {
objectManage
.
viewer
.
scene
.
viewFlag
=
false
;
}
});
this
.
chooseView
();
}
chooseView
()
{
if
(
this
.
pointHandler
.
active
)
return
;
...
...
@@ -75,4 +74,8 @@ export default class visual {
//激活绘制点类
this
.
pointHandler
.
activate
();
}
remove
()
{
this
.
viewshed3D
.
destroy
();
this
.
viewshed3D
=
new
Cesium
.
ViewShed3D
(
objectManage
.
viewer
.
scene
);
}
}
\ No newline at end of file
...
...
src/components/allSee.vue
View file @
386e0a8
...
...
@@ -47,7 +47,7 @@
}
},
mounted
()
{
this
.
viewpoint
instanceof
viewpoint
||
(
this
.
viewpoint
=
new
viewpoint
(
this
.
viewer
));
this
.
viewpoint
instanceof
viewpoint
||
(
this
.
viewpoint
=
new
viewpoint
());
},
methods
:
{
closePop
()
{
...
...
@@ -57,11 +57,10 @@
},
startAnalysis
()
{
// this.isAnalysis = true;
this
.
viewpoint
.
chooseView
();
},
stopAnalysis
()
{
// this.isAnalysis = false;
this
.
viewpoint
.
remove
();
}
}
...
...
src/components/kgAnalusis.vue
View file @
386e0a8
...
...
@@ -11,7 +11,7 @@
<span
@
click=
"closePop"
class=
"close"
>
×
</span>
</div>
<div
class=
""
style=
"padding: 18px 24px 0px 24px;"
>
<el-slider
v-model=
"height"
:min=
'
0
'
:max=
'1000'
:format-tooltip=
"formatTooltip"
<el-slider
v-model=
"height"
:min=
'
1
'
:max=
'1000'
:format-tooltip=
"formatTooltip"
@
change=
'EheightChange'
></el-slider>
</div>
<div
class=
"func-btn"
>
...
...
@@ -24,62 +24,40 @@
<span>
清除分析结果
</span>
</div>
</div>
<div
class=
"table-box"
style=
"padding: 18px 24px 30px 24px;"
>
<el-table
:data=
"tableData"
:highlight-current-row=
'false'
height=
"242"
border
style=
"width: 100%"
>
<el-table-column
prop=
"name"
label=
"名称"
align=
'center'
>
</el-table-column>
<el-table-column
prop=
"height"
label=
"高度(m)"
align=
'center'
>
</el-table-column>
<el-table-column
prop=
"superelevation"
label=
"超高度(m)"
align=
'center'
>
</el-table-column>
</el-table>
</div>
</div>
</div>
</
template
>
<
script
>
import
heightControl
from
"../assets/js/map/heightControl"
;
export
default
{
name
:
'kgAnalusis'
,
components
:
{},
data
()
{
return
{
height
:
320
,
tableData
:
[{
name
:
'1号楼'
,
height
:
'34'
,
superelevation
:
'4'
},
{
name
:
'1号楼'
,
height
:
'34'
,
superelevation
:
'4'
},
{
name
:
'1号楼'
,
height
:
'34'
,
superelevation
:
'4'
},
{
name
:
'1号楼'
,
height
:
'34'
,
superelevation
:
'4'
},]
height
:
100
}
},
mounted
()
{},
mounted
()
{
this
.
heightControl
instanceof
heightControl
||
(
this
.
heightControl
=
new
heightControl
({
h
:
this
.
height
}));
},
methods
:
{
closePop
()
{
this
.
$emit
(
'closePop'
,
'kgAnalusis'
)
},
startAnalysis
()
{
this
.
heightControl
.
handlerPolygon
.
deactivate
();
this
.
heightControl
.
handlerPolygon
.
activate
();
},
stopAnalysis
()
{
this
.
heightControl
.
remove
();
},
formatTooltip
(
val
)
{
return
val
+
'米'
;
},
EheightChange
()
{
this
.
heightControl
.
polygon
.
height
=
this
.
height
;
this
.
heightControl
.
splice
(
this
.
height
);
}
}
}
...
...
src/components/tjxAnslysis.vue
View file @
386e0a8
...
...
@@ -41,7 +41,6 @@
</
template
>
<
script
>
import
height
from
"../assets/js/map/heightControl"
;
export
default
{
name
:
'tjxAnslysis'
,
components
:
{},
...
...
@@ -51,18 +50,16 @@
}
},
mounted
()
{
this
.
height
instanceof
height
||
(
this
.
height
=
new
height
());
},
methods
:
{
closePop
()
{
this
.
$emit
(
'closePop'
,
'tjxAnslysis'
)
},
startAnalysis
()
{
this
.
height
.
handlerPolygon
.
deactivate
();
this
.
height
.
handlerPolygon
.
activate
();
},
stopAnalysis
()
{
this
.
height
.
polygon
.
height
=
50
;
},
}
}
...
...
src/components/visualField.vue
View file @
386e0a8
...
...
@@ -123,11 +123,12 @@
closePop
()
{
this
.
$emit
(
'closePop'
,
'visualField'
)
},
handleChange
()
{
startAnalysis
()
{
this
.
visual
.
chooseView
();
},
stopAnalysis
()
{
this
.
visual
.
remove
();
},
startAnalysis
()
{},
stopAnalysis
()
{},
handleIsXmbj
(
flag
)
{
this
.
isXmbj
=
flag
;
}
...
...
src/components/ymAnslysis.vue
View file @
386e0a8
...
...
@@ -69,7 +69,7 @@
step
:
0.01
,
num
:
1
,
sdgc
:
''
,
// 水底高程
swsd
:
''
,
// 水位深度
swsd
:
50
,
// 水位深度
ymsd
:
''
,
// 淹没速度
isXmbj
:
true
,
// isAnalysis: true
...
...
@@ -86,15 +86,11 @@
},
startAnalysis
()
{
// this.isAnalysis = true;
let
viewer
=
this
.
$parent
.
viewer
;
this
.
flood
.
floodParse
(
viewer
.
scene
,
this
.
flood
.
positions2d
,
0
,
50
);
this
.
flood
.
floodParse
(
0
,
this
.
swsd
);
this
.
flood
.
handlerPolygon
.
clear
();
},
stopAnalysis
()
{
// this.isAnalysis = false;
objectManage
.
viewer
.
entities
.
removeAll
();
// this.$parent.flood.handlerPolygon.clear();
this
.
flood
.
remove
();
},
handleIsXmbj
(
flag
)
{
this
.
isXmbj
=
flag
;
...
...
src/views/Home.vue
View file @
386e0a8
...
...
@@ -218,20 +218,28 @@
scene
.
hdrEnabled
=
false
;
scene
.
sun
.
show
=
true
;
this
.
draw
=
new
createDraw
(
this
.
viewer
);
Cesium
.
when
.
all
([
scene
.
addS3MTilesLayerByScp
(
URL_CONFIG
.
SCP_CBD_GROUND1
,
{
name
:
'ground'
}),
scene
.
addS3MTilesLayerByScp
(
URL_CONFIG
.
SCP_CBD_BUILD
,
{
name
:
'build'
})
],
layers
=>
{
var
promise
=
[];
// promise[0] = scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_GROUND1, {
// name: 'ground'
// });
promise
[
0
]
=
scene
.
addS3MTilesLayerByScp
(
URL_CONFIG
.
SCP_CBD_BUILD
,
{
name
:
'build1'
});
promise
[
1
]
=
scene
.
addS3MTilesLayerByScp
(
URL_CONFIG
.
SCP_CBD_BUILD
,
{
name
:
'build2'
});
promise
[
2
]
=
scene
.
addS3MTilesLayerByScp
(
URL_CONFIG
.
SCP_CBD_GROUND1
,
{
name
:
'ground'
});
Cesium
.
when
.
all
(
promise
,
layers
=>
{
// this.layers = layer;
objectManage
.
viewer
=
this
.
viewer
;
layers
[
0
].
selectEnabled
=
false
;
layers
[
1
].
selectEnabled
=
false
;
layers
[
0
].
shadowType
=
2
;
layers
[
1
].
shadowType
=
2
;
//
layers[0].selectEnabled = false;
//
layers[1].selectEnabled = false;
//
layers[0].shadowType = 2;
//
layers[1].shadowType = 2;
scene
.
camera
.
setView
({
destination
:
Cesium
.
Cartesian3
.
fromDegrees
(
116.44621857300415
,
39.899281526734555
,
216.7793905027196
),
orientation
:
{
...
...
Please
register
or
sign in
to post a comment