| | |
| | | const closePanoramaPopup = () => { |
| | | panoramaShow.value = false |
| | | } |
| | | let addPupoLayers = {} |
| | | |
| | | const data = [ |
| | | { |
| | |
| | | backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png', |
| | | className: 'yjc-box', |
| | | showPanel: false, |
| | | layerName: 'yjc' |
| | | layerName: 'yjc', |
| | | incident: (e) => { |
| | | const { attrParams } = e.overlay |
| | | // 删除 |
| | | destroy() |
| | | if (!attrParams.imageUrl) { |
| | | return |
| | | } |
| | | addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPupoLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <img src="${attrParams.imageUrl}" width="160" height="160" /> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, 64), |
| | | `<div class="public-map-popup-two"> |
| | | ${iconEl} |
| | | </div>` |
| | | ) |
| | | let incident = () => { |
| | | destroy() |
| | | } |
| | | divIcon.on(DC.MouseEventType.CLICK, incident) |
| | | addPupoLayers[attrParams.name].addOverlay(divIcon) |
| | | } |
| | | }, |
| | | { |
| | | id: '3-2', |
| | |
| | | backgroundIcon: VITE_APP_BASE + 'img/mapicon/ysf.png', |
| | | className: 'ysf-box', |
| | | showPanel: false, |
| | | layerName: 'fm' |
| | | layerName: 'fm', |
| | | incident: (e) => { |
| | | const { attrParams } = e.overlay |
| | | // 删除 |
| | | destroy() |
| | | if (!attrParams.imageUrl) { |
| | | return |
| | | } |
| | | addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPupoLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <img src="${attrParams.imageUrl}" width="160" height="160" /> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, 64), |
| | | `<div class="public-map-popup-two"> |
| | | ${iconEl} |
| | | </div>` |
| | | ) |
| | | let incident = () => { |
| | | destroy() |
| | | } |
| | | divIcon.on(DC.MouseEventType.CLICK, incident) |
| | | addPupoLayers[attrParams.name].addOverlay(divIcon) |
| | | } |
| | | }, |
| | | |
| | | { |
| | |
| | | type: 4, |
| | | size: 1000 |
| | | }, |
| | | layerName: 'wstsbz' |
| | | layerName: 'wstsbz', |
| | | incident: (e) => { |
| | | const { attrParams } = e.overlay |
| | | // 删除 |
| | | destroy() |
| | | if (!attrParams.imageUrl) { |
| | | return |
| | | } |
| | | addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPupoLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <img src="${attrParams.imageUrl}" width="160" height="160" /> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, 64), |
| | | `<div class="public-map-popup-two"> |
| | | ${iconEl} |
| | | </div>` |
| | | ) |
| | | let incident = () => { |
| | | destroy() |
| | | } |
| | | divIcon.on(DC.MouseEventType.CLICK, incident) |
| | | addPupoLayers[attrParams.name].addOverlay(divIcon) |
| | | } |
| | | }, |
| | | |
| | | { |
| | |
| | | backgroundIcon: VITE_APP_BASE + 'img/mapicon/sk.png', |
| | | className: 'sk-box', |
| | | showPanel: false, |
| | | layerName: 'sk' |
| | | layerName: 'sk', |
| | | incident: (e) => { |
| | | const { attrParams } = e.overlay |
| | | // 删除 |
| | | destroy() |
| | | if (!attrParams.imageUrl) { |
| | | return |
| | | } |
| | | addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPupoLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <img src="${attrParams.imageUrl}" width="160" height="160" /> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, 64), |
| | | `<div class="public-map-popup-two"> |
| | | ${iconEl} |
| | | </div>` |
| | | ) |
| | | let incident = () => { |
| | | destroy() |
| | | } |
| | | divIcon.on(DC.MouseEventType.CLICK, incident) |
| | | addPupoLayers[attrParams.name].addOverlay(divIcon) |
| | | } |
| | | }, |
| | | |
| | | { |
| | |
| | | backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjb.png', |
| | | className: 'yjb-box', |
| | | showPanel: false, |
| | | layerName: 'yjb' |
| | | layerName: 'yjb', |
| | | incident: (e) => { |
| | | const { attrParams } = e.overlay |
| | | // 删除 |
| | | destroy() |
| | | if (!attrParams.imageUrl) { |
| | | return |
| | | } |
| | | addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPupoLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <img src="${attrParams.imageUrl}" width="160" height="160" /> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, 64), |
| | | `<div class="public-map-popup-two"> |
| | | ${iconEl} |
| | | </div>` |
| | | ) |
| | | let incident = () => { |
| | | destroy() |
| | | } |
| | | divIcon.on(DC.MouseEventType.CLICK, incident) |
| | | addPupoLayers[attrParams.name].addOverlay(divIcon) |
| | | } |
| | | }, |
| | | |
| | | { |
| | |
| | | backgroundIcon: VITE_APP_BASE + 'img/mapicon/xfs.png', |
| | | className: 'xfs-box', |
| | | showPanel: false, |
| | | layerName: 'xfs' |
| | | layerName: 'xfs', |
| | | incident: (e) => { |
| | | const { attrParams } = e.overlay |
| | | // 删除 |
| | | destroy() |
| | | if (!attrParams.imageUrl) { |
| | | return |
| | | } |
| | | addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPupoLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <img src="${attrParams.imageUrl}" width="160" height="160" /> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, 64), |
| | | `<div class="public-map-popup-two"> |
| | | ${iconEl} |
| | | </div>` |
| | | ) |
| | | let incident = () => { |
| | | destroy() |
| | | } |
| | | divIcon.on(DC.MouseEventType.CLICK, incident) |
| | | addPupoLayers[attrParams.name].addOverlay(divIcon) |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | |
| | | incident: (e) => { |
| | | const { attrParams } = e.overlay |
| | | panoramaTitle.value = attrParams.name |
| | | |
| | | if ( |
| | | attrParams.url.indexOf("http://vr.jxpskj.com:180") != -1 |
| | | ) { |
| | |
| | | "/panorama" |
| | | ) |
| | | } |
| | | |
| | | panoramaUrl.value = attrParams.url |
| | | panoramaShow.value = true |
| | | } |
| | |
| | | |
| | | divIcon.attrParams = i |
| | | |
| | | let incident = () => { } |
| | | let incident = () => { |
| | | } |
| | | |
| | | if (item.incident) incident = item.incident |
| | | |
| | |
| | | addTileLayers[item.layerName] = new DC.VectorLayer(item.layerName) |
| | | window.$viewer.addLayer(addTileLayers[item.layerName]) |
| | | |
| | | function computeCircle (radius) { |
| | | function computeCircle(radius) { |
| | | var positions = [] |
| | | for (var i = 0; i < 360; i++) { |
| | | var radians = DC.Math.toRadians(i) |
| | |
| | | }) |
| | | } |
| | | |
| | | function findObjectById (data, id) { |
| | | function findObjectById(data, id) { |
| | | // 遍历数据数组 |
| | | for (let i = 0; i < data.length; i++) { |
| | | const item = data[i] |
| | |
| | | // watch(sharedData, (newValue) => { |
| | | // }); |
| | | |
| | | |
| | | // 销毁 |
| | | function destroy() { |
| | | tileLayers && window.$viewer.removeLayer(tileLayers) |
| | | let arr = Object.keys(addPupoLayers) |
| | | arr.filter(i => i != 'hgyq').forEach(i => { |
| | | addPupoLayers[i] && window.$viewer.removeLayer(addPupoLayers[i]) |
| | | }) |
| | | addPupoLayers = {} |
| | | } |
| | | |
| | | onUnmounted(() => { |
| | | tileLayers && window.$viewer.removeLayer(tileLayers) |
| | |
| | | arr.filter(i => i != 'hgyq').forEach(i => { |
| | | addTileLayers[i] && window.$viewer.removeLayer(addTileLayers[i]) |
| | | }) |
| | | // 弹窗销毁 |
| | | destroy() |
| | | |
| | | EventBus.off('restHandleCheckChange', restHandleCheckChange) |
| | | EventBus.off('restHandleDelChange', restHandleDelChange) |