Commit a6cc9055 authored by 郭铭瑶's avatar 郭铭瑶 🤘

恢复地图全息道路路面,全息道路部件,周边白模图层代码

parent 7cb46791
import { onUnmounted } from 'vue'
import { onBeforeUnmount } from 'vue'
import * as esriloader from 'esri-loader'
import useJsApi from '@/hooks/useJsApi'
import sceneViewPopup from '@/util/sceneViewPopup'
......@@ -16,6 +16,7 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
let map: any = null
let sceneView: any = null
let graphiclayer: any = null
let timer: any = null
esriloader.loadScript({ url: config.jsApiUrl })
......@@ -180,6 +181,46 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
graphiclayer = new GraphicsLayer()
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', () => {
if (window.modelHighlight) {
window.modelHighlight.remove()
......@@ -193,7 +234,9 @@ export default async function useInitMap(el: HTMLElement, camera: any) {
addEventListener()
onUnmounted(() => {
onBeforeUnmount(() => {
clearInterval(timer)
timer = null
map = null
window.map = null
sceneView = null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment