From 23217c44db56b1d85757cdcef59baa2cf026ff50 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 24 Dec 2021 09:56:23 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/school-web
---
src/components/map/index.vue | 178 ++++++++++++++++++++++++++++++++++++----------------------
1 files changed, 110 insertions(+), 68 deletions(-)
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index a6112c9..5a134fc 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -6,17 +6,24 @@
<left-nav ref="leftNav"></left-nav>
<mapPopup />
+
+ <!-- <campusBuildingSearch /> -->
+ <div class="keep-out">
+ 智慧校园
+ </div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
-import mapPopup from './component/mapPopup.vue'
+import mapPopup from './components/mapPopup.vue'
+import campusBuildingSearch from './components/campusBuildingSearch.vue'
export default {
name: 'mapBox',
components: {
- mapPopup
+ mapPopup,
+ campusBuildingSearch
},
data () {
return {
@@ -140,95 +147,117 @@
name: '影像'
})
- // eslint-disable-next-line camelcase
- const baselayer_shaded = that.DC.ImageryLayerFactory.createArcGisImageryLayer({
- url:
- 'http://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer'
- })
- viewer.addBaseLayer(baselayer_shaded, {
- iconUrl: 'examples/images/icon/elec.png',
- name: '电子'
- })
+ // // eslint-disable-next-line camelcase
+ // const baselayer_shaded = that.DC.ImageryLayerFactory.createArcGisImageryLayer({
+ // url:
+ // 'http://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer'
+ // })
+ // viewer.addBaseLayer(baselayer_shaded, {
+ // iconUrl: 'examples/images/icon/elec.png',
+ // name: '电子'
+ // })
- // eslint-disable-next-line camelcase
- const baselayer_street = that.DC.ImageryLayerFactory.createArcGisImageryLayer({
- url:
- 'http://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer'
- })
- viewer.addBaseLayer(baselayer_street, {
- iconUrl: 'examples/images/icon/ter.png',
- name: '地形'
- })
+ // // eslint-disable-next-line camelcase
+ // const baselayer_street = that.DC.ImageryLayerFactory.createArcGisImageryLayer({
+ // url:
+ // 'http://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer'
+ // })
+ // viewer.addBaseLayer(baselayer_street, {
+ // iconUrl: 'examples/images/icon/ter.png',
+ // name: '地形'
+ // })
- // eslint-disable-next-line camelcase
- const baselayer_ter = that.DC.ImageryLayerFactory.createArcGisImageryLayer({
- url:
- 'http://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer'
- })
- viewer.addBaseLayer(baselayer_ter, {
- iconUrl: 'examples/images/icon/ter.png',
- name: '地形'
- })
+ // // eslint-disable-next-line camelcase
+ // const baselayer_ter = that.DC.ImageryLayerFactory.createArcGisImageryLayer({
+ // url:
+ // 'http://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer'
+ // })
+ // viewer.addBaseLayer(baselayer_ter, {
+ // iconUrl: 'examples/images/icon/ter.png',
+ // name: '地形'
+ // })
- const layer = new that.DC.TilesetLayer('layer')
- viewer.addLayer(layer)
+ const tilesetLayer = new that.DC.TilesetLayer('tilesetLayer')
+ viewer.addLayer(tilesetLayer)
const tileset = new that.DC.Tileset(
- 'http://resource.dvgis.cn/data/3dtiles/ljz/tileset.json'
+ 'http://data.mars3d.cn/3dtiles/max-shihua/tileset.json',
+ {
+ luminanceAtZenith: 0.5
+ }
)
- 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 that.DC.Measure())
-
- tileset.setStyle(style)
- layer.addOverlay(tileset)
+ tilesetLayer.addOverlay(tileset)
viewer.flyTo(tileset)
-
tileset.on(that.DC.MouseEventType.CLICK, e => {
- // that.popupFlag = true
-
viewer.scene.globe.depthTestAgainstTerrain = false
+
+ that.$store.commit('CLEAR_ALL', null)
+
+ var imgArr = ['http://223.82.109.183:2081/zhxy/upload/20211222/f66dc4527eb4cc1b2d33fa3a5b345ed0.jpg']
+
+ that.$store.commit('SET_POPUPBGURL', imgArr[0])
+ that.$store.commit('SET_POPUPQRURL', 'http://223.82.109.183:2081/zhxy/upload/20211222/9c324adea5d9e5b50cd8f874d5f780f4.png')
+ that.$store.commit('SET_POINTPOSITION', [Number(e.wgs84Position.lng), Number(e.wgs84Position.lat), Number(e.wgs84Position.alt), Number(0), Number(0), Number(0)])
+ that.$store.commit('SET_STATENAME', e.overlay.attr.name)
+ that.$store.commit('SET_SITENAME', e.overlay.attr['地址'])
+ that.$store.commit('SET_POPUPIMGATLAS', imgArr)
// 定制化窗体
// eslint-disable-next-line no-unused-vars
- var popup = new that.DC.DivForms(that.viewer, {
+ var popup = new that.DC.DivForms(viewer, {
domId: 'divFormsDomBox',
position: [
- e.position
+ that.DC.Transform.transformWGS84ToCartesian(new that.DC.Position(Number(e.wgs84Position.lng), Number(e.wgs84Position.lat), Number(e.wgs84Position.alt), Number(0), Number(0), Number(0)))
]
})
- that.$store.commit('SET_PANORAMAPOPUP', false)
that.$store.commit('SET_DETAILSPOPUP', true)
+ that.$store.commit('SET_PANORAMAPOPUP', false)
})
- // viewer.zoomToPosition(
- // new DC.Position(105.565571, 31.984708, 15362816, 0, -90)
+ const wallLayer = new that.DC.VectorLayer('wallLayer')
+ viewer.addLayer(wallLayer)
+ var arr = [
+ [115.87597219, 28.74628526, 100],
+ [115.87556558, 28.74415792, 100],
+ [115.87459782, 28.74197687, 100],
+ [115.87371834, 28.74219927, 100],
+ [115.87210924, 28.74182217, 100],
+ [115.86469971, 28.73630725, 100],
+ [115.86387107, 28.73620123, 100],
+ [115.86274498, 28.73616026, 100],
+ [115.86173699, 28.74241350, 100],
+ [115.86105468, 28.74643934, 100],
+ [115.86609240, 28.74642593, 100],
+ [115.87597219, 28.74628526, 100]
+ ]
+ arr.forEach(item => {
+ item = item.join(',')
+ })
+ arr = arr.join(';')
+ const wall = new that.DC.Wall(
+ arr
+ )
+ wall.setStyle({
+ material: new that.DC.WallTrailMaterialProperty({
+ color: that.DC.Namespace.Cesium.Color.fromBytes(0, 142, 255, 150),
+ // color: that.DC.Color.CYAN,
+ speed: 10
+ })
+ })
+ wallLayer.addOverlay(wall)
+
+ // viewer.use(new that.DC.Measure())
+
+ // viewer.flyTo(wallLayer)
+
+ // viewer.flyToPosition(
+ // new that.DC.Position(117.08489820, 31.65413916, 1500, 0, -90, 45)
// )
viewer.compass.enable = true
viewer.zoomController.enable = true
- viewer.locationBar.enable = true
- viewer.distanceLegend.enable = true
+ // viewer.locationBar.enable = true
+ // viewer.distanceLegend.enable = true
}
that.DC.ready(initViewer)
@@ -240,4 +269,17 @@
</script>
<style lang='scss' scope>
+.keep-out {
+ position: fixed;
+ left: 6px;
+ bottom: 2px;
+ z-index: 11;
+ width: 72px;
+ height: 30px;
+ line-height: 30px;
+ text-align: center;
+ background: rgba(0, 0, 0, 0.8);
+ color: #fff;
+ border-radius: 8px;
+}
</style>
--
Gitblit v1.9.3