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
c0e79425
authored
2020-08-13 16:42:43 +0800
by
jikai
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
111111
1 parent
0527650f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
7 deletions
src/assets/js/map/createDraw.js
src/assets/js/map/flood.js
src/assets/js/map/heightControl.js
src/components/tjxAnslysis.vue
src/views/Home.vue
src/assets/js/map/createDraw.js
View file @
c0e7942
...
...
@@ -10,7 +10,7 @@ export default class createDraw {
}
distance
()
{
this
.
handlerDis
.
measureEvt
.
addEventListener
(
result
=>
{
var
dis
=
Number
(
result
.
distance
),
distance
=
dis
>
1000
?
(
dis
/
1000
).
toFixed
(
2
)
+
'km'
:
dis
.
toFixed
(
2
)
+
'm'
;
var
dis
=
Number
(
result
.
distance
),
distance
=
dis
>
1000
?
(
dis
/
1000
).
toFixed
(
2
)
+
'km'
:
dis
.
toFixed
(
2
)
+
'm'
;
this
.
handlerDis
.
disLabel
.
text
=
'距离:'
+
distance
;
});
this
.
handlerDis
.
activeEvt
.
addEventListener
(
this
.
handle
());
...
...
src/assets/js/map/flood.js
View file @
c0e7942
...
...
@@ -18,8 +18,7 @@ export default class flood {
this
.
positions2d
.
push
(
latitude
);
this
.
positions2d
.
push
(
1000.0
);
}
}
return
positions
;
}
});
}
initHyp
()
{
...
...
src/assets/js/map/heightControl.js
0 → 100644
View file @
c0e7942
import
objectManage
from
'./maputils'
;
export
default
class
heightControl
{
constructor
()
{
this
.
handlerPolygon
=
new
Cesium
.
DrawHandler
(
objectManage
.
viewer
,
Cesium
.
DrawMode
.
Polygon
);
this
.
handlerPolygon
.
drawEvt
.
addEventListener
(
result
=>
{
var
array
=
[].
concat
(
result
.
object
.
positions
),
positions
=
[];
var
polygon
=
result
.
object
;
if
(
!
polygon
)
return
;
polygon
.
show
=
false
;
this
.
handlerPolygon
.
polyline
.
show
=
false
;
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
);
if
(
positions
.
indexOf
(
longitude
)
===-
1
&&
positions
.
indexOf
(
latitude
)
===-
1
){
positions
.
push
(
longitude
);
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
;
});
}
}
\ No newline at end of file
src/components/tjxAnslysis.vue
View file @
c0e7942
...
...
@@ -41,6 +41,7 @@
</
template
>
<
script
>
import
height
from
"../assets/js/map/heightControl"
;
export
default
{
name
:
'tjxAnslysis'
,
components
:
{},
...
...
@@ -49,16 +50,19 @@
src
:
'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3820738330,1510784229&fm=26&gp=0.jpg'
}
},
mounted
()
{},
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/views/Home.vue
View file @
c0e7942
...
...
@@ -127,6 +127,7 @@
// 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'
;
...
...
@@ -194,6 +195,24 @@
}
},
mounted
()
{
// loadModules([
// "esri/Map",
// "esri/Basemap",
// "esri/views/MapView",
// "esri/layers/TileLayer",
// "esri/layers/WebTileLayer",
// // "dojo/domReady!"
// ]).then(([Map, Basemap, MapView, TileLayer, WebTileLayer]) => {
// // let configure = mapUrl[a],
// // args = { baseLayers: [] };
// // configure.layers.forEach(e => {
// // args.baseLayers.push(new WebTileLayer(e));
// // });
// // configure.url && (args.baseLayers.thumbnailUrl = configure.url);
// // this.map.basemap = new Basemap(args);
// });
this
.
viewer
=
new
Cesium
.
Viewer
(
'cesiumContainer'
,
{
shadows
:
true
});
this
.
viewer
.
imageryLayers
.
addImageryProvider
(
new
Cesium
.
TiandituImageryProvider
({
credit
:
new
Cesium
.
Credit
(
'天地图全球影像服务'
),
...
...
@@ -233,7 +252,8 @@
var
title
=
'加载SCP失败,请检查网络连接状态或者url地址是否正确?'
;
widget
.
showErrorPanel
(
title
,
undefined
,
e
);
}
});
});
},
methods
:
{
searchRoat
(
val
)
{
...
...
@@ -331,6 +351,7 @@
EtjxAnslysis
(
val
)
{
this
[
val
]
=
!
this
[
val
];
this
.
onlySelect
(
val
);
},
// 可视化分析
EvisualField
(
val
)
{
...
...
@@ -346,6 +367,7 @@
EkgAnalusis
(
val
)
{
this
[
val
]
=
!
this
[
val
];
this
.
onlySelect
(
val
);
},
// 关闭pop方法
closePop
(
val
)
{
...
...
Please
register
or
sign in
to post a comment