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
5a33fe6a
Commit
5a33fe6a
authored
May 13, 2026
by
feiwenli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 119.3.70.207:zhangzhaohui/map-property-screen
parents
7c04337a
afbbdc4a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
7 deletions
+37
-7
wcjd.js
src/api/wcjd.js
+5
-0
cesium.js
src/utils/cesium.js
+21
-2
index.vue
src/view/index.vue
+6
-5
vite.config.js
vite.config.js
+5
-0
No files found.
src/api/wcjd.js
0 → 100644
View file @
5a33fe6a
import
axios
from
"axios"
;
export
function
getWcjdToken
()
{
return
axios
.
get
(
"/wcjd/as"
);
}
src/utils/cesium.js
View file @
5a33fe6a
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
,
...
...
src/view/index.vue
View file @
5a33fe6a
...
@@ -105,8 +105,9 @@ function drawCommunityMarker(arr) {
...
@@ -105,8 +105,9 @@ function drawCommunityMarker(arr) {
// 绘制小区标记
// 绘制小区标记
function
drawHouseMarker
(
arr
)
{
function
drawHouseMarker
(
arr
)
{
arr
.
forEach
((
item
)
=>
{
arr
.
forEach
((
item
)
=>
{
let
position
=
JSON
.
parse
(
item
.
solid
);
let
position
=
cartesianToDegrees
(
JSON
.
parse
(
item
.
solid
));
console
.
log
(
"position"
,
position
);
position
=
degreesToCartesian
(
position
)
console
.
log
(
position
)
drawLabel
(
position
,
item
.
name
,
"#003860"
,
"blue_dw_icon"
,
{
drawLabel
(
position
,
item
.
name
,
"#003860"
,
"blue_dw_icon"
,
{
...
item
,
...
item
,
type
:
"house"
,
type
:
"house"
,
...
@@ -142,13 +143,13 @@ function cartesianToDegrees(cartesian) {
...
@@ -142,13 +143,13 @@ function cartesianToDegrees(cartesian) {
let
longitude
=
Cesium
.
Math
.
toDegrees
(
cartographic
.
longitude
);
let
longitude
=
Cesium
.
Math
.
toDegrees
(
cartographic
.
longitude
);
let
latitude
=
Cesium
.
Math
.
toDegrees
(
cartographic
.
latitude
);
let
latitude
=
Cesium
.
Math
.
toDegrees
(
cartographic
.
latitude
);
return
{
return
{
longitude
,
x
:
longitude
,
latitude
,
y
:
latitude
,
};
};
}
}
// cesium 经纬度转笛卡尔坐标
// cesium 经纬度转笛卡尔坐标
function
degreesToCartesian
(
position
)
{
function
degreesToCartesian
(
position
)
{
let
cartesian3
=
Cesium
.
Cartesian3
.
fromDegrees
(
position
.
x
,
position
.
y
);
let
cartesian3
=
Cesium
.
Cartesian3
.
fromDegrees
(
position
.
x
,
position
.
y
,
0
);
return
cartesian3
;
return
cartesian3
;
}
}
// 镜头飞到某个位置
// 镜头飞到某个位置
...
...
vite.config.js
View file @
5a33fe6a
...
@@ -27,6 +27,11 @@ export default defineConfig({
...
@@ -27,6 +27,11 @@ export default defineConfig({
changeOrigin
:
true
,
changeOrigin
:
true
,
// rewrite: (path) => path.replace(/^\/prod-api/, ""),
// rewrite: (path) => path.replace(/^\/prod-api/, ""),
},
},
"/wcjd"
:
{
target
:
"http://10.35.66.214:8080/"
,
changeOrigin
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
wcjd/
,
""
),
},
},
},
},
},
resolve
:
{
resolve
:
{
...
...
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