| | |
| | | } |
| | | ], |
| | | viewer: null, |
| | | DC: null, |
| | | tagLayer: null, |
| | | wayLayer: null, |
| | | sceneLayer: null, |
| | |
| | | } |
| | | }, |
| | | created () { |
| | | this.DC = global.DC |
| | | }, |
| | | mounted () { |
| | | // 初始化新增标签图层 |
| | |
| | | } |
| | | getTagList().then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | const divIcon = new this.DC.DivIcon( |
| | | new that.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | ` |
| | | <div class="tag-entitys-box"> |
| | | <div class="tag-content"> |
| | |
| | | for (let i = 0; i < num; i++) { |
| | | const lng = 115.86271917 + Math.random() * 0.01 |
| | | const lat = 28.73615593 + Math.random() * 0.02 |
| | | list.push(new this.DC.Position(lng, lat, 0)) |
| | | list.push(new global.DC.Position(lng, lat, 0)) |
| | | } |
| | | return list |
| | | }, |
| | |
| | | var that = this |
| | | viewer.scene.globe.depthTestAgainstTerrain = false |
| | | this.viewer = viewer |
| | | this.tagLayer = new this.DC.HtmlLayer('tagLayer') |
| | | this.tagLayer = new global.DC.HtmlLayer('tagLayer') |
| | | viewer.addLayer(this.tagLayer) |
| | | this.wayLayer = new this.DC.HtmlLayer('wayLayer') |
| | | this.wayLayer = new global.DC.HtmlLayer('wayLayer') |
| | | viewer.addLayer(this.wayLayer) |
| | | this.sceneLayer = new this.DC.HtmlLayer('sceneLayer') |
| | | this.sceneLayer = new global.DC.HtmlLayer('sceneLayer') |
| | | viewer.addLayer(this.sceneLayer) |
| | | this.monitorLayer = new this.DC.HtmlLayer('monitorLayer') |
| | | this.monitorLayer = new global.DC.HtmlLayer('monitorLayer') |
| | | viewer.addLayer(this.monitorLayer) |
| | | this.aedLayer = new this.DC.VectorLayer('aedLayer') |
| | | this.aedLayer = new global.DC.VectorLayer('aedLayer') |
| | | viewer.addLayer(this.aedLayer) |
| | | this.parkLayer = new this.DC.HtmlLayer('parkLayer') |
| | | this.parkLayer = new global.DC.HtmlLayer('parkLayer') |
| | | viewer.addLayer(this.parkLayer) |
| | | this.comeLayer = new this.DC.VectorLayer('comeLayer') |
| | | this.comeLayer = new global.DC.VectorLayer('comeLayer') |
| | | viewer.addLayer(this.comeLayer) |
| | | |
| | | getTagList().then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | const divIcon = new this.DC.DivIcon( |
| | | new that.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | ` |
| | | <div class="tag-entitys-box"> |
| | | <div class="tag-content"> |
| | |
| | | |
| | | getWayList().then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | const divIcon = new this.DC.DivIcon( |
| | | new that.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | ` |
| | | <div class="way-entitys-box"> |
| | | <div class="way-title" style="border: white 1px solid; font-size: 0.875rem; background: #0066ff; width: 18px; line-height: 14px; padding: 6px 2px 6px 2px; color: white; text-align: center;"> |
| | |
| | | |
| | | getMonitorList().then((res) => { |
| | | res.data.data.records.forEach((item) => { |
| | | const divIcon = new this.DC.DivIcon( |
| | | new that.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | ` |
| | | <div class="monitor-entitys-box"> |
| | | <div>${item.vrname}</div> |
| | |
| | | divIcon.attrParams = item |
| | | this.monitorLayer.addOverlay(divIcon) |
| | | |
| | | divIcon.on(that.DC.MouseEventType.CLICK, (e) => { |
| | | divIcon.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | that.viewer.flyToPosition( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), Number(300), Number(0), Number(-90), Number(0)), |
| | | function () { }, |
| | |
| | | ) |
| | | this.$store.commit('SET_MONITORURL', e.overlay.attrParams.vrurl) |
| | | // eslint-disable-next-line new-cap |
| | | var positions = this.DC.Transform.transformWGS84ToCartesian( |
| | | var positions = global.DC.Transform.transformWGS84ToCartesian( |
| | | // eslint-disable-next-line new-cap |
| | | new this.DC.Position.fromArray([ |
| | | new global.DC.Position.fromArray([ |
| | | Number(item.jd), |
| | | Number(item.wd), |
| | | 0, |
| | |
| | | ) |
| | | this.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | // eslint-disable-next-line no-unused-vars |
| | | var monitor = new this.DC.PanoramaBox(this.viewer, { |
| | | var monitor = new global.DC.PanoramaBox(this.viewer, { |
| | | domId: 'MonitorBox', |
| | | position: [positions] |
| | | }) |
| | |
| | | |
| | | getSceneList().then((res) => { |
| | | res.data.data.records.forEach((item) => { |
| | | const divIcon = new this.DC.DivIcon( |
| | | new that.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | ` |
| | | <div class="scene-entitys-box"> |
| | | <div>${item.vrname}</div> |
| | |
| | | divIcon.attrParams = item |
| | | this.sceneLayer.addOverlay(divIcon) |
| | | |
| | | divIcon.on(that.DC.MouseEventType.CLICK, (e) => { |
| | | divIcon.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | that.viewer.flyToPosition( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), Number(300), Number(0), Number(-90), Number(0)), |
| | | function () { }, |
| | |
| | | e.overlay.attrParams.vrurl |
| | | ) |
| | | // eslint-disable-next-line new-cap |
| | | var positions = that.DC.Transform.transformWGS84ToCartesian( |
| | | var positions = global.DC.Transform.transformWGS84ToCartesian( |
| | | // eslint-disable-next-line new-cap |
| | | new that.DC.Position.fromArray([ |
| | | new global.DC.Position.fromArray([ |
| | | Number(item.jd), |
| | | Number(item.wd), |
| | | 0, |
| | |
| | | ) |
| | | this.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | // eslint-disable-next-line no-unused-vars |
| | | var panorama = new this.DC.PanoramaBox(this.viewer, { |
| | | var panorama = new global.DC.PanoramaBox(this.viewer, { |
| | | domId: 'PanoramaBox', |
| | | position: [positions] |
| | | }) |
| | |
| | | |
| | | getLifeList({ lifetype: 9 }).then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | const label = new this.DC.Label( |
| | | new that.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | const label = new global.DC.Label( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | item.mechanismname |
| | | ) |
| | | label.setStyle({ |
| | | fillColor: this.DC.Color.CRIMSON, |
| | | style: that.DC.Namespace.Cesium.LabelStyle.FILL_AND_OUTLINE, |
| | | outlineColor: that.DC.Color.WHITE, // 边框颜色 |
| | | fillColor: global.DC.Color.CRIMSON, |
| | | style: global.DC.Namespace.Cesium.LabelStyle.FILL_AND_OUTLINE, |
| | | outlineColor: global.DC.Color.WHITE, // 边框颜色 |
| | | outlineWidth: 8, // 边框大小, |
| | | font: '14px sans-serif', |
| | | pixelOffset: { x: 0, y: -24 } |
| | | }) |
| | | this.aedLayer.addOverlay(label) |
| | | |
| | | const billboard = new this.DC.Billboard( |
| | | new that.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | const billboard = new global.DC.Billboard( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | '/img/leftnav/map-aed.png' |
| | | ) |
| | | billboard.size = [20, 20] |
| | |
| | | |
| | | getLifeList({ lifetype: 11 }).then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | const divIcon = new this.DC.DivIcon( |
| | | new that.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | ` |
| | | <div class="park-entitys-box"> |
| | | <div class="park-title" alt="${item.mechanismname}"> |
| | |
| | | |
| | | getLifeList({ lifetype: 12 }).then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | const label = new that.DC.Label( |
| | | new that.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | const label = new global.DC.Label( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | item.mechanismname |
| | | ) |
| | | label.setStyle({ |
| | | fillColor: that.DC.Color.FUCHSIA, |
| | | style: that.DC.Namespace.Cesium.LabelStyle.FILL_AND_OUTLINE, |
| | | outlineColor: that.DC.Color.WHITE, // 边框颜色 |
| | | fillColor: global.DC.Color.FUCHSIA, |
| | | style: global.DC.Namespace.Cesium.LabelStyle.FILL_AND_OUTLINE, |
| | | outlineColor: global.DC.Color.WHITE, // 边框颜色 |
| | | outlineWidth: 8, // 边框大小, |
| | | font: '14px sans-serif', |
| | | pixelOffset: { x: 0, y: -40 } |
| | | }) |
| | | that.comeLayer.addOverlay(label) |
| | | |
| | | const billboard = new that.DC.Billboard( |
| | | new that.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | const billboard = new global.DC.Billboard( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | '/img/leftnav/map-activity.png' |
| | | ) |
| | | billboard.size = [20, 20] |
| | |
| | | }) |
| | | }, |
| | | openPopups (value) { |
| | | var popup = new this.DC.DivForms(this.viewer, { |
| | | var popup = new global.DC.DivForms(this.viewer, { |
| | | domId: 'divFormsDomBox', |
| | | position: [ |
| | | this.DC.Transform.transformWGS84ToCartesian( |
| | | new this.DC.Position( |
| | | global.DC.Transform.transformWGS84ToCartesian( |
| | | new global.DC.Position( |
| | | Number(value.lng), |
| | | Number(value.lat), |
| | | Number(value.alt || 0) |