| | |
| | | <div id="viewer-container" |
| | | style="height: 100%; width: 100%;"> |
| | | |
| | | <div v-show='popupFlag' |
| | | id="modelPopup" |
| | | style="width: 366px; |
| | | height: 240px; |
| | | background: url(/img/bg/nav-bg.jpeg) no-repeat; |
| | | background-size: 100% 100%;"> |
| | | <div class="header"> |
| | | <div class="logo"> |
| | | <img src="/img/navicon/map.png" |
| | | alt=""> |
| | | </div> |
| | | <div class="title"> |
| | | 明德楼 |
| | | </div> |
| | | <div class="close"> |
| | | <img src="/img/navicon/close.png" |
| | | alt=""> |
| | | </div> |
| | | </div> |
| | | <div class="content"> |
| | | <div class="img"> |
| | | <left-nav ref="leftNav"></left-nav> |
| | | |
| | | </div> |
| | | <div class="meau"> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="map_popup_content"> |
| | | </div> |
| | | |
| | | <div ref="mapContentContent" v-show="false" id="map_content_content"> |
| | | <div class="arc-bcg"> |
| | | <img src="/img/job/one.jpg" |
| | | alt="" |
| | | @click="alert(1)"> |
| | | </div> |
| | | </div> |
| | | |
| | | <mapPopup /> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | |
| | | import { mapGetters } from 'vuex' |
| | | import mapPopup from './component/mapPopup.vue' |
| | | |
| | | export default { |
| | | name: 'mapBox', |
| | | components: { |
| | | mapPopup |
| | | }, |
| | | data () { |
| | | return { |
| | | popupFlag: false |
| | | DC: null |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'viewer' |
| | | 'viewer', |
| | | 'popupBgUrl', |
| | | 'pupupQRUrl', |
| | | // 终点 |
| | | 'terminus', |
| | | // 起点 |
| | | 'startingPoint', |
| | | // 点信息 |
| | | 'pointPosition', |
| | | // 点名称 |
| | | 'stateName', |
| | | // 地址 |
| | | 'siteName', |
| | | // 介绍 |
| | | 'introduceText', |
| | | // 全景地址 |
| | | 'panoramaUrl', |
| | | // 详情弹框显示关闭 |
| | | 'detailsPopup', |
| | | // 全景弹框显示关闭 |
| | | 'panoramaPopup' |
| | | ]) |
| | | }, |
| | | mounted () { |
| | | var DC = global.DC |
| | | |
| | | var that = this |
| | | |
| | | let viewer |
| | | |
| | | that.DC = global.DC |
| | | |
| | | function distanceSurface () { |
| | | viewer.measure.distanceSurface() |
| | |
| | | } |
| | | |
| | | function initViewer () { |
| | | viewer = new DC.Viewer('viewer-container', { |
| | | viewer = new that.DC.Viewer('viewer-container', { |
| | | contextOptions: { |
| | | webgl: { |
| | | stencil: true, |
| | |
| | | } |
| | | }) |
| | | |
| | | console.log(DC, 456) |
| | | that.$store.commit('SET_VIEWER', viewer) |
| | | |
| | | that.$refs.leftNav.initialize(viewer) |
| | | |
| | | const popup = viewer.popup |
| | | |
| | | popup.hide() |
| | | |
| | | that.$store.commit('SET_VIEWER', viewer) |
| | | |
| | | const baselayer = DC.ImageryLayerFactory.createArcGisImageryLayer({ |
| | | const baselayer = that.DC.ImageryLayerFactory.createArcGisImageryLayer({ |
| | | url: |
| | | 'http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer' |
| | | }) |
| | |
| | | }) |
| | | |
| | | // eslint-disable-next-line camelcase |
| | | const baselayer_shaded = DC.ImageryLayerFactory.createArcGisImageryLayer({ |
| | | const baselayer_shaded = that.DC.ImageryLayerFactory.createArcGisImageryLayer({ |
| | | url: |
| | | 'http://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer' |
| | | }) |
| | |
| | | }) |
| | | |
| | | // eslint-disable-next-line camelcase |
| | | const baselayer_street = DC.ImageryLayerFactory.createArcGisImageryLayer({ |
| | | const baselayer_street = that.DC.ImageryLayerFactory.createArcGisImageryLayer({ |
| | | url: |
| | | 'http://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer' |
| | | }) |
| | |
| | | }) |
| | | |
| | | // eslint-disable-next-line camelcase |
| | | const baselayer_ter = DC.ImageryLayerFactory.createArcGisImageryLayer({ |
| | | const baselayer_ter = that.DC.ImageryLayerFactory.createArcGisImageryLayer({ |
| | | url: |
| | | 'http://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer' |
| | | }) |
| | |
| | | name: '地形' |
| | | }) |
| | | |
| | | const layer = new DC.TilesetLayer('layer') |
| | | const layer = new that.DC.TilesetLayer('layer') |
| | | viewer.addLayer(layer) |
| | | const tileset = new DC.Tileset( |
| | | const tileset = new that.DC.Tileset( |
| | | 'http://resource.dvgis.cn/data/3dtiles/ljz/tileset.json' |
| | | ) |
| | | const style = new DC.TilesetStyle() |
| | | const style = new that.DC.TilesetStyle() |
| | | style.color = { |
| | | conditions: [ |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 300', 'rgba(45, 0, 75, 0.5)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 200', 'rgb(102, 71, 151)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 100', 'rgb(170, 162, 204)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 50', 'rgb(224, 226, 238)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 25', 'rgb(252, 230, 200)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 10', 'rgb(248, 176, 87)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 5', 'rgb(198, 106, 11)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['true', 'rgb(127, 59, 8)'] |
| | | ] |
| | | } |
| | | |
| | | viewer.use(new DC.Measure()) |
| | | viewer.use(new that.DC.Measure()) |
| | | |
| | | tileset.setStyle(style) |
| | | layer.addOverlay(tileset) |
| | | viewer.flyTo(tileset) |
| | | |
| | | tileset.on(DC.MouseEventType.CLICK, e => { |
| | | tileset.on(that.DC.MouseEventType.CLICK, e => { |
| | | // that.popupFlag = true |
| | | |
| | | console.log(e.position) |
| | | |
| | | viewer.scene.globe.depthTestAgainstTerrain = false |
| | | |
| | | console.log(document.getElementById('map_content_content')) |
| | | |
| | | // 定制化窗体 |
| | | var divForms = new DC.divForms(viewer, { |
| | | domId: 'div1', |
| | | title: '成教楼 ', |
| | | className: 'divForms-dom', |
| | | content: document.getElementById('map_content_content'), |
| | | // eslint-disable-next-line no-unused-vars |
| | | var popup = new that.DC.DivForms(that.viewer, { |
| | | domId: 'divFormsDomBox', |
| | | position: [ |
| | | e.position |
| | | ] |
| | | }) |
| | | |
| | | // popup.setWrapper('<div></div>') |
| | | |
| | | // popup.showAt(e.position, document.getElementById('modelPopup')) |
| | | that.$store.commit('SET_PANORAMAPOPUP', false) |
| | | that.$store.commit('SET_DETAILSPOPUP', true) |
| | | }) |
| | | |
| | | // viewer.zoomToPosition( |
| | |
| | | viewer.distanceLegend.enable = true |
| | | } |
| | | |
| | | DC.ready(initViewer) |
| | | that.DC.ready(initViewer) |
| | | }, |
| | | methods: { |
| | | |