Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
map-property-screen
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
zhangzhaohui
map-property-screen
Commits
c3a1989d
Commit
c3a1989d
authored
Jun 24, 2024
by
zhangzhaohui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加资规3dtile
parent
90fe36d2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
wcjd.js
src/api/wcjd.js
+5
-0
cesium.js
src/utils/cesium.js
+21
-2
No files found.
src/api/wcjd.js
0 → 100644
View file @
c3a1989d
import
axios
from
"axios"
;
export
function
getWcjdToken
()
{
return
axios
.
get
(
"/wcjd/as"
);
}
src/utils/cesium.js
View file @
c3a1989d
import
*
as
Cesium
from
"cesium"
;
import
*
as
Cesium
from
"cesium"
;
import
{
getWcjdToken
}
from
'../api/wcjd'
export
let
viewer
;
export
let
viewer
;
export
function
cesiumInit
(
id
)
{
export
function
cesiumInit
(
id
)
{
...
@@ -33,8 +34,26 @@ export function cesiumInit(id) {
...
@@ -33,8 +34,26 @@ export function cesiumInit(id) {
viewer
.
scene
.
screenSpaceCameraController
.
inertiaTranslate
=
0
;
viewer
.
scene
.
screenSpaceCameraController
.
inertiaTranslate
=
0
;
viewer
.
_cesiumWidget
.
_creditContainer
.
style
.
display
=
"none"
;
// 隐藏版权信息
viewer
.
_cesiumWidget
.
_creditContainer
.
style
.
display
=
"none"
;
// 隐藏版权信息
viewer
.
scene
.
postProcessStages
.
fxaa
.
enabled
=
true
;
//开启抗锯齿
viewer
.
scene
.
postProcessStages
.
fxaa
.
enabled
=
true
;
//开启抗锯齿
viewer
.
scene
.
globe
.
depthTestAgainstTerrain
=
true
;
//深度
// viewer.scene.globe.depthTestAgainstTerrain = true; //深度
const
getTileset
=
async
()
=>
{
const
token
=
(
await
getWcjdToken
()).
data
.
datas
.
token
;
const
tileset
=
await
Cesium
.
Cesium3DTileset
.
fromUrl
(
"http://10.35.66.214/haishu-map-server/3dtiles/hs_wcjd/tileset.json?tk="
+
token
,
{
maximumScreenSpaceError
:
16
,
maximumMemoryUsage
:
1024
,
skipLevelOfDetail
:
true
,
}
);
viewer
.
scene
.
primitives
.
add
(
tileset
);
viewer
.
scene
.
globe
.
depthTestAgainstTerrain
=
false
;
};
try
{
getTileset
();
}
catch
(
error
)
{
console
.
error
(
"3dtiles resources restricted"
);
}
//提高亮度
//提高亮度
viewer
.
scene
.
light
=
new
Cesium
.
DirectionalLight
({
viewer
.
scene
.
light
=
new
Cesium
.
DirectionalLight
({
direction
:
viewer
.
scene
.
camera
.
directionWC
,
direction
:
viewer
.
scene
.
camera
.
directionWC
,
...
...
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