Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
huamu
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
郭铭瑶
huamu
Commits
a6cc9055
Commit
a6cc9055
authored
Sep 29, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
恢复地图全息道路路面,全息道路部件,周边白模图层代码
parent
7cb46791
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
2 deletions
+45
-2
useInitMap.ts
src/hooks/useInitMap.ts
+45
-2
No files found.
src/hooks/useInitMap.ts
View file @
a6cc9055
import
{
on
Unmounted
}
from
'vue'
import
{
on
BeforeUnmount
}
from
'vue'
import
*
as
esriloader
from
'esri-loader'
import
*
as
esriloader
from
'esri-loader'
import
useJsApi
from
'@/hooks/useJsApi'
import
useJsApi
from
'@/hooks/useJsApi'
import
sceneViewPopup
from
'@/util/sceneViewPopup'
import
sceneViewPopup
from
'@/util/sceneViewPopup'
...
@@ -16,6 +16,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
...
@@ -16,6 +16,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
let
map
:
any
=
null
let
map
:
any
=
null
let
sceneView
:
any
=
null
let
sceneView
:
any
=
null
let
graphiclayer
:
any
=
null
let
graphiclayer
:
any
=
null
let
timer
:
any
=
null
esriloader
.
loadScript
({
url
:
config
.
jsApiUrl
})
esriloader
.
loadScript
({
url
:
config
.
jsApiUrl
})
...
@@ -180,6 +181,46 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
...
@@ -180,6 +181,46 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
graphiclayer
=
new
GraphicsLayer
()
graphiclayer
=
new
GraphicsLayer
()
map
.
add
(
graphiclayer
)
map
.
add
(
graphiclayer
)
const
sceneLayer3
=
new
SceneLayer
({
url
:
'https://hm.metrodata.cn/cehuiyuan/changsanjiao/rest/services/Hosted/HM_ROAD0730/SceneServer'
,
visible
:
true
,
title
:
'全息道路路面'
,
elevationInfo
:
{
mode
:
'absolute-height'
,
offset
:
3
,
},
})
const
sceneLayer4
=
new
SceneLayer
({
url
:
'https://hm.metrodata.cn/cehuiyuan/changsanjiao/rest/services/Hosted/HM_BUJIAN0730/SceneServer'
,
visible
:
true
,
title
:
'全息道路部件'
,
elevationInfo
:
{
mode
:
'absolute-height'
,
offset
:
3
,
},
minScale
:
2500
,
})
const
sceneLayer7
=
new
SceneLayer
({
url
:
'https://hm.metrodata.cn/cehuiyuan/changsanjiao/rest/services/Hosted/HM_WHITEMODEL_OUTSIDE0320/SceneServer'
,
visible
:
true
,
title
:
'周边白模'
,
popupEnabled
:
false
,
})
const
modelGroupLayer
=
new
GroupLayer
({
title
:
'其他模型'
,
visible
:
true
,
visibilityMode
:
'independent'
,
layers
:
[
sceneLayer3
,
sceneLayer4
,
sceneLayer7
],
opacity
:
1
,
})
timer
=
setInterval
(
function
()
{
map
.
layers
.
add
(
modelGroupLayer
)
},
15000
)
watchUtils
.
whenFalse
(
sceneView
.
popup
,
'visible'
,
()
=>
{
watchUtils
.
whenFalse
(
sceneView
.
popup
,
'visible'
,
()
=>
{
if
(
window
.
modelHighlight
)
{
if
(
window
.
modelHighlight
)
{
window
.
modelHighlight
.
remove
()
window
.
modelHighlight
.
remove
()
...
@@ -193,7 +234,9 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
...
@@ -193,7 +234,9 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
addEventListener
()
addEventListener
()
onUnmounted
(()
=>
{
onBeforeUnmount
(()
=>
{
clearInterval
(
timer
)
timer
=
null
map
=
null
map
=
null
window
.
map
=
null
window
.
map
=
null
sceneView
=
null
sceneView
=
null
...
...
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