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
1753f4e4
authored
2020-08-17 17:18:54 +0800
by
刘远
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
2 parents
bbcd565f
f47e11be
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
111 deletions
src/components/arcgisMap.vue
src/components/threeMap.vue
src/views/Home.vue
src/components/arcgisMap.vue
0 → 100644
View file @
1753f4e
<
template
>
<div>
<div
id=
"arcgisMap"
></div>
</div>
</
template
>
<
script
>
import
{
loadModules
}
from
"esri-loader"
;
export
default
{
data
()
{
return
{}
},
mounted
()
{
loadModules
([
"esri/Map"
,
"esri/views/MapView"
,
"esri/layers/WebTileLayer"
,
"esri/geometry/Extent"
,
"dojo/domReady!"
]).
then
(([
Map
,
MapView
,
WebTileLayer
,
Extent
])
=>
{
this
.
$parent
.
mapView
=
new
MapView
({
container
:
"arcgisMap"
,
map
:
new
Map
({
basemap
:
{
baseLayers
:
[
new
WebTileLayer
({
urlTemplate
:
"http://mt{subDomain}.google.cn/vt/lyrs=s&hl=zh-CN&gl=CN&x={col}&y={row}&z={level}&s=Gali"
,
subDomains
:
[
"0"
,
"1"
,
"2"
]
}),
new
WebTileLayer
({
urlTemplate
:
"http://mt{subDomain}.google.cn/vt/imgtp=png32&lyrs=h@207000000&hl=zh-CN&gl=cn&x={col}&y={row}&z={level}&s=Galil"
,
subDomains
:
[
"0"
,
"1"
,
"2"
]
})
]
}
}),
extent
:
new
Extent
({
xmin
:
413417
,
ymin
:
3715140
,
xmax
:
665512
,
ymax
:
3902165
,
spatialReference
:
4545
}),
zoom
:
5
});
});
},
methods
:
{
}
}
</
script
>
<
style
>
#arcgisMap
{
width
:
100%
;
height
:
100%
;
}
</
style
>
\ No newline at end of file
src/components/threeMap.vue
View file @
1753f4e
<
template
>
<div>
<div
id=
"cesiumContainer"
>
<div
id=
"cesiumContainer"
ref=
"cesium"
>
<div
id=
"vertical-slider"
style=
"display: none;"
></div>
<div
id=
"horizontal-slider"
style=
"display: none;"
></div>
</div>
...
...
@@ -21,9 +21,7 @@
},
data
()
{
return
{
viewer
:
undefined
}
return
{}
},
mounted
()
{
let
viewer
=
new
Cesium
.
Viewer
(
'cesiumContainer'
,
{
shadows
:
true
});
...
...
src/views/Home.vue
View file @
1753f4e
...
...
@@ -91,36 +91,9 @@
<addProjectMsg
@
closeAddProjectMsg=
'EcloseAddProjectMsg'
></addProjectMsg>
</div>
<div
id=
"cesiumContainer"
>
<div
id=
"vertical-slider"
style=
"display: none;"
></div>
<div
id=
"horizontal-slider"
style=
"display: none;"
></div>
</div>
<!--
<div
id=
"split_up"
style=
"display: none;"
></div>
<div
id=
"split_bottom"
style=
"display: none;"
></div>
<div
id=
"split_left"
style=
"display: none;"
></div>
<div
id=
"split_right"
style=
"display: none;"
></div>
-->
<!--
<div
id=
"loadingbar"
class=
"spinner"
>
<div
class=
"spinner-container container1"
>
<div
class=
"circle1"
></div>
<div
class=
"circle2"
></div>
<div
class=
"circle3"
></div>
<div
class=
"circle4"
></div>
</div>
<div
class=
"spinner-container container2"
>
<div
class=
"circle1"
></div>
<div
class=
"circle2"
></div>
<div
class=
"circle3"
></div>
<div
class=
"circle4"
></div>
</div>
<div
class=
"spinner-container container3"
>
<div
class=
"circle1"
></div>
<div
class=
"circle2"
></div>
<div
class=
"circle3"
></div>
<div
class=
"circle4"
></div>
</div>
</div>
-->
<!--
<threeMap
ref=
"threeMap"
></threeMap>
<arcgisMap
ref=
"arcgisMap"
></arcgisMap>
-->
<component
:is=
"map"
></component>
<!-- 动态组件-->
</div>
</
template
>
...
...
@@ -129,9 +102,7 @@
import
objectManage
from
'../assets/js/map/maputils'
;
import
createDraw
from
'../assets/js/map/createDraw'
;
import
roller
from
"../assets/js/map/roller"
;
// import flood from "../assets/js/map/flood";
// import viewpoint from "../assets/js/map/viewpoint";
// import visual from "../assets/js/map/visual";
import
{
loadModules
}
from
"esri-loader"
;
import
TopTitle
from
'../components/topTitle'
;
...
...
@@ -141,6 +112,8 @@
import
leftAssert
from
'../components/leftAssert'
;
// import mapPop from '../components/mapPop';
import
arcgisMap
from
'../components/arcgisMap'
;
//二维地图
import
threeMap
from
'../components/threeMap'
;
//三维地图
import
allSee
from
'../components/allSee'
;
//通视
import
ymAnslysis
from
'../components/ymAnslysis'
;
//淹没分析
import
horizon
from
'../components/horizon'
;
// 视域分析
...
...
@@ -163,6 +136,8 @@
bottomNav
,
leftAssert
,
// mapPop,
arcgisMap
,
threeMap
,
allSee
,
ymAnslysis
,
...
...
@@ -208,107 +183,38 @@
}
},
mounted
()
{
this
.
viewer
=
new
Cesium
.
Viewer
(
'cesiumContainer'
,
{
shadows
:
true
});
this
.
viewer
.
imageryLayers
.
addImageryProvider
(
new
Cesium
.
TiandituImageryProvider
({
credit
:
new
Cesium
.
Credit
(
'天地图全球影像服务'
),
token
:
URL_CONFIG
.
TOKEN_TIANDITU
}));
let
scene
=
this
.
viewer
.
scene
scene
.
shadowMap
.
darkness
=
1
;
//设置第二重烘焙纹理的效果(明暗程度)
scene
.
skyAtmosphere
.
brightnessShift
=
0.4
;
scene
.
debugShowFramesPerSecond
=
true
;
scene
.
hdrEnabled
=
false
;
scene
.
sun
.
show
=
true
;
this
.
draw
=
new
createDraw
(
this
.
viewer
);
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;
console
.
log
(
layers
);
layers
[
1
].
shadowType
=
2
;
layers
[
2
].
shadowType
=
2
;
scene
.
camera
.
setView
({
destination
:
Cesium
.
Cartesian3
.
fromDegrees
(
116.44621857300415
,
39.899281526734555
,
216.7793905027196
),
orientation
:
{
heading
:
0.41348036210986194
,
pitch
:
-
0.13636490404291735
,
roll
:
6.283185307179563
}
});
},
function
(
e
){
if
(
widget
.
_showRenderLoopErrors
)
{
var
title
=
'加载SCP失败,请检查网络连接状态或者url地址是否正确?'
;
widget
.
showErrorPanel
(
title
,
undefined
,
e
);
}
});
objectManage
.
viewer
=
this
.
viewer
;
},
methods
:
{
searchRoat
(
val
)
{
/**
* @param {*} val '为地名地址道路的输入值'
*/
this
.
commons
.
log
(
val
)
},
is2D
(
flag
)
{
/**
* @param {*} flag 'true 选中2D, falss 反之为3D'
*/
this
.
commons
.
log
(
flag
)
this
.
map
=
flag
?
'arcgisMap'
:
'threeMap'
;
},
isCamera
(
flag
)
{
/**
* @param {*} flag 'true 选中影像, falss 反之'
*/
this
.
commons
.
log
(
flag
)
},
isLayer
(
flag
)
{
/**
* @param {*} flag 'true 选中图层, falss 反之'
*/
this
.
commons
.
log
(
flag
)
},
isClear
(
flag
)
{
// this.commons.log(flag)
this
.
draw
.
handlerDis
.
clear
();
this
.
draw
.
handlerArea
.
clear
();
this
.
draw
.
handlerHeight
.
clear
();
this
.
viewer
.
scene
.
layers
.
find
(
"build1"
).
clearCustomClipBox
();
this
.
viewer
.
scene
.
layers
.
find
(
"build2"
).
clearCustomClipBox
();
}
// rightFunc
// 复位
,
EisReturn
(
val
)
{}
// 放大
,
EisReturn
(
val
)
{}
,
Eenlarge
()
{
this
.
viewer
.
camera
.
zoomIn
(
300
);
}
// 缩小
,
Enarrow
()
{
,
EEnarrow
()
{
this
.
viewer
.
camera
.
zoomOut
(
300
);
}
// 坐标
,
Ecoordinate
()
{
}
// 距离
,
Edistance
(
val
)
{
this
.
draw
.
handlerDis
.
activate
();
}
...
...
@@ -605,5 +511,5 @@
}
</
style
>
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment