From 443c649303cc275f4ff07b3d2f5e589047f8054d Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 29 Apr 2022 17:24:06 +0800
Subject: [PATCH] 内容更改
---
src/router/page/index.js | 10
src/pcLayout/index.vue | 3
src/api/pc/label.js | 17 +
src/pcviews/technique/path.vue | 2
src/components/mobileCortrolButtom/index.vue | 18 +
src/pcviews/technique/data.vue | 2
src/components/map/index.vue | 3
src/components/mobilemap/index.vue | 6
src/pcviews/technique/graph.vue | 4
src/pcviews/technique/space.vue | 192 +++++++---------
src/pcviews/large/index.vue | 102 +++++++-
src/pcviews/technique/turf.vue | 179 ++++++++++++++++
public/img/bg/echarts-content.png | 0
public/img/bg/echarts-title.png | 0
src/mobileDivForms/mobileDivForms.js | 67 +++---
15 files changed, 431 insertions(+), 174 deletions(-)
diff --git a/public/img/bg/echarts-content.png b/public/img/bg/echarts-content.png
new file mode 100644
index 0000000..489c7ef
--- /dev/null
+++ b/public/img/bg/echarts-content.png
Binary files differ
diff --git a/public/img/bg/echarts-title.png b/public/img/bg/echarts-title.png
new file mode 100644
index 0000000..198e6cb
--- /dev/null
+++ b/public/img/bg/echarts-title.png
Binary files differ
diff --git a/src/api/pc/label.js b/src/api/pc/label.js
index bd379c7..2eb26bd 100644
--- a/src/api/pc/label.js
+++ b/src/api/pc/label.js
@@ -2,7 +2,7 @@
* @Author: Morpheus
* @Date: 2021-05-09 15:17:44
* @Last Modified by: Morpheus
- * @Last Modified time: 2021-12-14 08:58:30
+ * @Last Modified time: 2022-04-29 16:53:53
*/
// 党群机构
import request from '@/router/axios'
@@ -15,10 +15,21 @@
})
}
+export const uploadImg = (data) => {
+ return request({
+ url: 'blade-resource/oss/endpoint/put-files-talk',
+ method: 'post',
+ data: data,
+ headers: {
+ 'Content-Type': 'multipart/form-data'
+ }
+ })
+}
+
export const getlabel = () => {
return request({
url: 'tagging/tagging/list',
- method: 'get',
+ method: 'get'
})
}
@@ -30,4 +41,4 @@
ids: id
}
})
-}
\ No newline at end of file
+}
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index 7f30efb..0498e75 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -275,8 +275,7 @@
selectionIndicator: false,
timeline: false,
navigationHelpButton: false,
- navigationInstructionsInitiallyVisible: false,
- creditContainer: undefined
+ navigationInstructionsInitiallyVisible: false
// sceneMode: global.DC.Namespace.Cesium.SceneMode.SCENE2D
})
diff --git a/src/components/mobileCortrolButtom/index.vue b/src/components/mobileCortrolButtom/index.vue
index c26b9a2..beaff78 100644
--- a/src/components/mobileCortrolButtom/index.vue
+++ b/src/components/mobileCortrolButtom/index.vue
@@ -67,6 +67,7 @@
]
}
},
+ props: ['mapCenter', 'frislayertHeight'],
computed: {
...mapGetters([
'openmobileGoTo',
@@ -126,7 +127,22 @@
// }
// return;
// }
- window.startPointFn()
+ var that = this
+
+ global.viewer.flyToPosition(
+ new global.DC.Position(
+ that.mapCenter[0],
+ that.mapCenter[1],
+ that.frislayertHeight,
+ that.dimensionData.heading,
+ that.dimensionData.pitch,
+ that.dimensionData.roll
+ ),
+ () => {
+
+ },
+ 0
+ )
},
openActivity () {
const d = {
diff --git a/src/components/mobilemap/index.vue b/src/components/mobilemap/index.vue
index ce3099f..261b43b 100644
--- a/src/components/mobilemap/index.vue
+++ b/src/components/mobilemap/index.vue
@@ -10,7 +10,11 @@
<!-- 控制↓ -->
<mobileLeftNav ref="mobileLeftNav"></mobileLeftNav>
<mobileCortrol ref="mobileCortrol"></mobileCortrol>
- <mobileCortrolButtom ref="mobileCortrolButtom"></mobileCortrolButtom>
+ <mobileCortrolButtom
+ ref="mobileCortrolButtom"
+ :mapCenter="mapCenter"
+ :frislayertHeight="frislayertHeight"
+ ></mobileCortrolButtom>
<mobileCortrolSearch ref="mobileCortrolSearch"></mobileCortrolSearch>
<!-- 控制↑ -->
<!-- 控制大弹窗的弹窗 -->
diff --git a/src/mobileDivForms/mobileDivForms.js b/src/mobileDivForms/mobileDivForms.js
index 9e95996..1c6d774 100644
--- a/src/mobileDivForms/mobileDivForms.js
+++ b/src/mobileDivForms/mobileDivForms.js
@@ -10,8 +10,6 @@
import DC from '@dvgis/dc-sdk/dist/dc.base.min' // 基础包
import DcCore from '@dvgis/dc-sdk/dist/dc.core.min' // 核心包
-var $ = window.$
-
DC.use(DcCore) // 安装DC核心库
class mobileDivForms {
@@ -20,36 +18,36 @@
*
*/
constructor(viewer, popup) {
- this._viewer = viewer;
- this._popup = popup;
- this._position = popup.position;
- this._title = popup.title;
- this._content = popup.content;
- this.appendPopup();
- this.isOpen = true;
+ this._viewer = viewer
+ this._popup = popup
+ this._position = popup.position
+ this._title = popup.title
+ this._content = popup.content
+ this.appendPopup()
+ this.isOpen = true
}
- get viewer() {
+ get viewer () {
return this._viewer
}
- get title() {
+ get title () {
return this._title
}
- get content() {
+ get content () {
return this._content
}
- get popup() {
+ get popup () {
return this._popup
}
- get position() {
+ get position () {
return this._position
}
- appendPopup() {
+ appendPopup () {
/**
* @domId 存放 dom 的id, 多个数组,单个字符串
*/
@@ -58,9 +56,9 @@
}
// 创建元素并追加
- createVideoWindowAll(id, className, position) {
- let dom = document.getElementById('mobile-map_popup_content');
- dom.style.display = 'block';
+ createVideoWindowAll (id, className, position) {
+ const dom = document.getElementById('mobile-map_popup_content')
+ dom.style.display = 'block'
var childs = document.getElementById('mobile-map_popup_content').getElementsByTagName('div')
@@ -72,20 +70,22 @@
var self = this
- var el = $("<div class=''></div>")
+ // var el = $("<div class=''></div>")
+
+ var el = document.createElement('div')
// var titleDiv = $("<div class='mobiletitle'></div>").text(this._title)
// var labelContent = $("<div class='mobilelabel-content'></div>").append(this._content)
// el.append(titleDiv)
// el.append(labelContent)
- el.append(this._content)
+ el.appendChild(this._content)
- el.attr('id', id)
+ el.setAttribute('id', id)
- el.addClass(className || '')
+ el.setAttribute('class', className || '')
- $('#mobile-map_popup_content').append(el)
+ document.getElementById('mobile-map_popup_content').appendChild(el)
// let time;
// function cons(e) {
// time = setTimeout(() => {
@@ -101,7 +101,7 @@
this._viewer.scene.postRender.addEventListener(function (e) {
if (!self.isOpen) {
- return;
+ return
}
const windowCoord = DC.Namespace.Cesium.SceneTransforms.wgs84ToWindowCoordinates(
self._viewer.scene,
@@ -112,14 +112,14 @@
})
}
- positionPopUp(windowCoord, id) {
+ positionPopUp (windowCoord, id) {
if (!windowCoord) {
- return;
+ return
}
// console.log(windowCoord)
- const wx = document.getElementById('app').clientWidth;
- const x = windowCoord.x - (wx / 100 * 35);
- const y = windowCoord.y - document.getElementById(id).offsetHeight - 15;
+ const wx = document.getElementById('app').clientWidth
+ const x = windowCoord.x - (wx / 100 * 35)
+ const y = windowCoord.y - document.getElementById(id).offsetHeight - 15
// x = windowCoord.x - document.getElementById(id).offsetWidth
// document.getElementById(id).style.cssText = `
@@ -129,10 +129,11 @@
transform:translate3d(${Math.round(x)}px,${Math.round(y)}px, 0);
`
}
- closeOur() {
- this.isOpen = false;
- let dom = document.getElementById('mobile-map_popup_content');
- dom.style.display = 'none';
+
+ closeOur () {
+ this.isOpen = false
+ const dom = document.getElementById('mobile-map_popup_content')
+ dom.style.display = 'none'
// var childs = document.getElementById('mobile-map_popup_content').getElementsByTagName('div')
// if (childs.length > 0) {
diff --git a/src/pcLayout/index.vue b/src/pcLayout/index.vue
index ae259fa..5501b8a 100644
--- a/src/pcLayout/index.vue
+++ b/src/pcLayout/index.vue
@@ -92,8 +92,9 @@
<el-menu-item index="/pcLayout/default/technique/map">地图数据</el-menu-item>
<el-menu-item index="/pcLayout/default/technique/video">视频融合</el-menu-item>
<el-menu-item index="/pcLayout/default/technique/data">数据动画</el-menu-item>
+ <el-menu-item index="/pcLayout/default/technique/turf">turf计算</el-menu-item>
<el-menu-item index="/pcLayout/default/technique/space">三维空间分析</el-menu-item>
- <el-menu-item index="/pcLayout/default/technique/graph">人口迁移</el-menu-item>
+ <el-menu-item index="/pcLayout/default/technique/graph">学生迁徙图</el-menu-item>
<el-menu-item index="/pcLayout/default/technique/path">漫游</el-menu-item>
</el-submenu>
</el-menu>
diff --git a/src/pcviews/large/index.vue b/src/pcviews/large/index.vue
index 36c58ab..7c3b93e 100644
--- a/src/pcviews/large/index.vue
+++ b/src/pcviews/large/index.vue
@@ -14,14 +14,34 @@
</div>
</div>
<div class="left-container">
- <div class="top" id="LeftTop"></div>
- <div class="center" id="LeftCenter"></div>
- <div class="bottom" id="LeftBottom"></div>
+ <div class="top">
+ <div class="l-title">
+ <span class="text">建筑统计</span>
+ </div>
+ <div class="l-content" id="LeftTop"></div>
+ </div>
+ <div class="center">
+ <div class="l-title"></div>
+ <div class="l-content" id="LeftCenter"></div>
+ </div>
+ <div class="bottom">
+ <div class="l-title"></div>
+ <div class="l-content" id="LeftBottom"></div>
+ </div>
</div>
<div class="right-container">
- <div class="top" id="RightTop"></div>
- <div class="center" id="RightCenter"></div>
- <div class="bottom" id="RightBottom"></div>
+ <div class="top">
+ <div class="r-title"></div>
+ <div class="r-content" id="RightTop"></div>
+ </div>
+ <div class="center">
+ <div class="r-title"></div>
+ <div class="r-content" id="RightCenter"></div>
+ </div>
+ <div class="bottom">
+ <div class="r-title"></div>
+ <div class="r-content" id="RightBottom"></div>
+ </div>
</div>
</div>
</template>
@@ -54,11 +74,8 @@
// 柱形图
// 因为初始化echarts 的时候,需要指定的容器 id='main'
this.$echarts.init(document.getElementById('LeftTop')).setOption({
- title: {
- text: '建筑物统计'
- },
grid: {
- // top: '2%',
+ top: '4%',
left: '3%',
right: '3%',
bottom: '2%',
@@ -69,19 +86,39 @@
nameRotate: 45,
data: ['文教建筑', '医疗建筑', '体育建筑', '展览建筑', '商业建筑', '行政建筑', '观演建筑'],
axisLabel: {
- color: '#5ce7ff',
+ color: '#fff',
rotate: 35
+ },
+ axisLine: {
+ show: true,
+ lineStyle: {
+ color: '#fff'
+ }
}
},
yAxis: {
- type: 'value'
+ type: 'value',
+ axisLabel: {
+ color: '#fff'
+ },
+ axisLine: {
+ show: true,
+ lineStyle: {
+ color: '#fff'
+ }
+ },
+ axisTick: {
+ show: true
+ },
+ splitLine: {
+ show: false
+ }
},
series: [{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
- showBackground: true,
- backgroundStyle: {
- color: 'rgba(220, 220, 220, 0.8)'
+ itemStyle: {
+ color: '#38ACD7'
}
}]
})
@@ -404,7 +441,7 @@
position: absolute;
top: 130px;
left: 10px;
- width: 24%;
+ width: 20%;
height: calc(100% - 140px);
// transform: rotateY(10deg);
// transform-origin: left center;
@@ -414,7 +451,7 @@
position: absolute;
top: 130px;
right: 10px;
- width: 24%;
+ width: 20%;
height: calc(100% - 140px);
}
@@ -432,11 +469,38 @@
}
.center {
- background: rgba(248, 248, 248, 0.75);
}
.bottom {
- background: rgba(248, 248, 248, 0.75);
+ }
+
+ .l-title,
+ .r-title {
+ position: relative;
+ height: 40px;
+ background: url('/img/bg/echarts-title.png');
+ background-size: 100% 100%;
+ color: #fff;
+
+ .text {
+ position: absolute;
+ top: 0;
+ left: 20px;
+ right: auto;
+ bottom: 0;
+ margin: auto;
+ font-size: 18px;
+ line-height: 40px;
+ font-weight: 700;
+ font-style: italic;
+ letter-spacing: 2px;
+ }
+ }
+ .l-content,
+ .r-content {
+ height: calc(100% - 40px);
+ background: url('/img/bg/echarts-content.png');
+ background-size: 100% 100%;
}
}
}
diff --git a/src/pcviews/technique/data.vue b/src/pcviews/technique/data.vue
index 06b5d8b..6412cdc 100644
--- a/src/pcviews/technique/data.vue
+++ b/src/pcviews/technique/data.vue
@@ -40,7 +40,7 @@
</li>
<li>
- 波纹雷达
+ 动态波纹
<el-switch
v-model="circleRadarShow"
:active-value="true"
diff --git a/src/pcviews/technique/graph.vue b/src/pcviews/technique/graph.vue
index 45a821c..80407db 100644
--- a/src/pcviews/technique/graph.vue
+++ b/src/pcviews/technique/graph.vue
@@ -5,14 +5,14 @@
<public-box class="technique-box">
<template slot="public-box-header">
<div class="title">
- <span>人口迁移</span>
+ <span>学生迁徙</span>
</div>
<img class="close deblurring" src="/img/navicon/close.png" alt @click="closeModel" />
</template>
<template slot="public-box-content">
<ul>
<li>
- 人口迁移
+ 学生迁徙
<el-switch
v-model="personShow"
:active-value="true"
diff --git a/src/pcviews/technique/path.vue b/src/pcviews/technique/path.vue
index 56b5f0f..42f7d7a 100644
--- a/src/pcviews/technique/path.vue
+++ b/src/pcviews/technique/path.vue
@@ -12,7 +12,7 @@
<template slot="public-box-content">
<ul>
<li>
- 路径漫游
+ 自动漫游
<el-switch
v-model="pathShow"
:active-value="true"
diff --git a/src/pcviews/technique/space.vue b/src/pcviews/technique/space.vue
index 65a1075..09f741d 100644
--- a/src/pcviews/technique/space.vue
+++ b/src/pcviews/technique/space.vue
@@ -12,30 +12,26 @@
<template slot="public-box-content">
<ul>
<li>
- 点位缓冲
+ 日照分析
<el-switch
- v-model="pointShow"
+ v-model="sunlightShow"
:active-value="true"
:inactive-value="false"
- @change="pointChange"
+ @change="sunlightChange"
></el-switch>
</li>
<li>
- 线缓冲
- <el-switch
- v-model="plineShow"
- :active-value="true"
- :inactive-value="false"
- @change="plineChange"
- ></el-switch>
+ 通视分析(圆)
+ <el-button type="primary" size="mini" @click="drawCircle">标绘</el-button>
+ <el-button type="primary" size="mini" @click="removeCircle">清除</el-button>
</li>
<li>
- 面缓冲
+ 可视域分析
<el-switch
- v-model="regionShow"
+ v-model="visualShow"
:active-value="true"
:inactive-value="false"
- @change="regionChange"
+ @change="visualChange"
></el-switch>
</li>
</ul>
@@ -45,130 +41,108 @@
<script>
-let pointTrufLayer = null
-let pointTrufPolygon = null
-let pointTrufPoint = null
+let sunlightLayer = null
+let tileset = null
+let plot = null
-let plineTrufLayer = null
-let plineTrufPolygon = null
-let plineTrufPline = null
-
-let regionTrufLayer = null
-let regionTrufRegion = null
-let regionTrufPolygon = null
+let visualLayer = null
+let visualTileset = null
export default {
data () {
return {
- pointShow: false,
- plineShow: false,
- regionShow: false
+ sunlightShow: false,
+ visualShow: false
}
},
mounted () {
+ plot = new global.DC.Plot(global.viewer, {
+ clampToGround: false
+ })
+
+ global.viewer.use(new global.DC.Analysis())
},
methods: {
closeModel () {
this.$router.push('/pcLayout/default')
},
- loadPoint () {
- pointTrufLayer = new global.DC.VectorLayer('pointTrufLayer')
- global.viewer.addLayer(pointTrufLayer)
- pointTrufPoint = new global.DC.Point('114.0415,27.6299,150')
- pointTrufLayer.addOverlay(pointTrufPoint)
- const coords = global.DC.GeoTools.pointBuffer('114.0415,27.6299', 50)
- pointTrufPolygon = new global.DC.Polygon(coords)
- pointTrufPolygon.setStyle({
- material: global.DC.Color.RED.withAlpha(0.4)
- })
- pointTrufLayer.addOverlay(pointTrufPolygon)
- global.viewer.flyTo(pointTrufLayer)
+ loadSunlight () {
+ sunlightLayer = new global.DC.TilesetLayer('sunlightLayer')
+ global.viewer.addLayer(sunlightLayer)
+ tileset = new global.DC.Tileset(
+ 'http://resource.dvgis.cn/data/3dtiles/ljz/tileset.json'
+ )
+ const style = new global.DC.TilesetStyle()
+ style.color = {
+ conditions: [
+ ['${Height} >= 300', 'rgba(45, 0, 75, 0.5)'],
+ ['${Height} >= 200', 'rgb(102, 71, 151)'],
+ ['${Height} >= 100', 'rgb(170, 162, 204)'],
+ ['${Height} >= 50', 'rgb(224, 226, 238)'],
+ ['${Height} >= 25', 'rgb(252, 230, 200)'],
+ ['${Height} >= 10', 'rgb(248, 176, 87)'],
+ ['${Height} >= 5', 'rgb(198, 106, 11)'],
+ ['true', 'rgb(127, 59, 8)']
+ ]
+ }
+ tileset.setStyle(style)
+ sunlightLayer.addOverlay(tileset)
+ global.viewer.flyTo(tileset)
+
+ global.viewer.analysis.shadows(new Date(), 1600)
},
- removePoint () {
- pointTrufPoint != null && pointTrufLayer.removeOverlay(pointTrufPoint)
- pointTrufPolygon != null && pointTrufLayer.removeOverlay(pointTrufPolygon)
- pointTrufLayer != null && global.viewer.removeLayer(pointTrufLayer)
- pointTrufPoint = null
- pointTrufPolygon = null
- pointTrufLayer = null
+ removeSunlight () {
+ global.viewer.analysis.deactivate(global.DC.AnalysisType.SHADOWS)
+ tileset != null && sunlightLayer.removeOverlay(tileset)
+ sunlightLayer != null && global.viewer.removeLayer(sunlightLayer)
+ tileset = null
+ sunlightLayer = null
},
- pointChange (e) {
+ sunlightChange (e) {
if (e) {
- this.loadPoint()
+ this.loadSunlight()
} else {
- this.removePoint()
+ this.removeSunlight()
}
},
- loadPline () {
- plineTrufLayer = new global.DC.VectorLayer('plineTrufLayer')
- global.viewer.addLayer(plineTrufLayer)
- plineTrufPline = new global.DC.Polyline('114.0411,27.62997062,152;114.0418,27.62997062,152')
- plineTrufPline.setStyle({
- width: 2,
- material: global.DC.Color.YELLOW,
- zIndex: 1
+ drawCircle () {
+ global.viewer.analysis.deactivate(global.DC.AnalysisType.SIGHT_CIRCLE)
+ plot.draw(global.DC.OverlayType.CIRCLE, overlay => {
+ global.viewer.analysis.sightCircle(overlay.center, overlay.radius, [])
})
- plineTrufLayer.addOverlay(plineTrufPline)
- const coords = global.DC.GeoTools.polylineBuffer('114.0411,27.62997062;114.0418,27.62997062', 50)
- plineTrufPolygon = new global.DC.Polygon(coords)
- plineTrufPolygon.setStyle({
- material: global.DC.Color.RED.withAlpha(0.4)
- })
- plineTrufLayer.addOverlay(plineTrufPolygon)
- global.viewer.flyTo(plineTrufLayer)
},
- removePline () {
- plineTrufPline != null && plineTrufLayer.removeOverlay(plineTrufPline)
- plineTrufPolygon != null && plineTrufLayer.removeOverlay(plineTrufPolygon)
- plineTrufLayer != null && global.viewer.removeLayer(plineTrufLayer)
- plineTrufPline = null
- plineTrufPolygon = null
- plineTrufLayer = null
+ removeCircle () {
+ global.viewer.analysis.deactivate(global.DC.AnalysisType.SIGHT_CIRCLE)
},
- plineChange (e) {
+ loadVisual () {
+ this.$EventBus.$emit('chinaDx', 'remove')
+ visualLayer = new global.DC.TilesetLayer('visualLayer').addTo(global.viewer)
+ visualTileset = new global.DC.Tileset('http://resource.dvgis.cn/data/3dtiles/dayanta/tileset.json')
+ visualTileset.setHeight(-420)
+ visualLayer.addOverlay(visualTileset)
+ global.viewer.flyTo(visualTileset)
+ global.viewer.analysis.viewshed('108.95772292882747,34.22122559229137,20,130', 400, 60, 1.3)
+ },
+ removeVisual () {
+ this.$EventBus.$emit('chinaDx', 'add')
+ global.viewer.analysis.deactivate(global.DC.AnalysisType.VIEWSHED)
+ visualTileset != null && visualLayer.removeOverlay(visualTileset)
+ visualLayer != null && global.viewer.removeLayer(visualLayer)
+ visualTileset = null
+ visualLayer = null
+ },
+ visualChange (e) {
if (e) {
- this.loadPline()
+ this.loadVisual()
} else {
- this.removePline()
- }
- },
- loadRegion () {
- regionTrufLayer = new global.DC.VectorLayer('regionTrufLayer')
- global.viewer.addLayer(regionTrufLayer)
- regionTrufRegion = new global.DC.Polygon('114.0410,27.6299,152;114.0418,27.6312,152;114.0426,27.6299,152')
- regionTrufRegion.setStyle({
- zIndex: 1,
- material: global.DC.Color.YELLOW
- })
- regionTrufLayer.addOverlay(regionTrufRegion)
- const coords = global.DC.GeoTools.polygonBuffer('114.0410,27.6299;114.0415,27.6312;114.0426,27.6299', 150)
- regionTrufPolygon = new global.DC.Polygon(coords)
- regionTrufPolygon.setStyle({
- material: global.DC.Color.RED.withAlpha(0.4)
- })
- regionTrufLayer.addOverlay(regionTrufPolygon)
- global.viewer.flyTo(regionTrufLayer)
- },
- removeRegion () {
- regionTrufRegion != null && regionTrufLayer.removeOverlay(regionTrufRegion)
- regionTrufPolygon != null && regionTrufLayer.removeOverlay(regionTrufPolygon)
- regionTrufLayer != null && global.viewer.removeLayer(regionTrufLayer)
- regionTrufRegion = null
- regionTrufPolygon = null
- regionTrufLayer = null
- },
- regionChange (e) {
- if (e) {
- this.loadRegion()
- } else {
- this.removeRegion()
+ this.removeVisual()
}
}
},
destroyed () {
- this.removePoint()
- this.removePline()
- this.removeRegion()
+ this.removeSunlight()
+ this.removeCircle()
+ this.removeVisual()
}
}
</script>
diff --git a/src/pcviews/technique/turf.vue b/src/pcviews/technique/turf.vue
new file mode 100644
index 0000000..6f81b2f
--- /dev/null
+++ b/src/pcviews/technique/turf.vue
@@ -0,0 +1,179 @@
+/* * @Author: Morpheus * @Name: 地图测距 * @Date: 2021-11-13 16:04:27 * @Last
+Modified by: Morpheus * @Last Modified time: 2022-02-15 14:28:44 */
+
+<template>
+ <public-box class="technique-box">
+ <template slot="public-box-header">
+ <div class="title">
+ <span>turf计算</span>
+ </div>
+ <img class="close deblurring" src="/img/navicon/close.png" alt @click="closeModel" />
+ </template>
+ <template slot="public-box-content">
+ <ul>
+ <li>
+ 点位缓冲
+ <el-switch
+ v-model="pointShow"
+ :active-value="true"
+ :inactive-value="false"
+ @change="pointChange"
+ ></el-switch>
+ </li>
+ <li>
+ 线缓冲
+ <el-switch
+ v-model="plineShow"
+ :active-value="true"
+ :inactive-value="false"
+ @change="plineChange"
+ ></el-switch>
+ </li>
+ <li>
+ 面缓冲
+ <el-switch
+ v-model="regionShow"
+ :active-value="true"
+ :inactive-value="false"
+ @change="regionChange"
+ ></el-switch>
+ </li>
+ </ul>
+ </template>
+ </public-box>
+</template>
+
+<script>
+
+let pointTrufLayer = null
+let pointTrufPolygon = null
+let pointTrufPoint = null
+
+let plineTrufLayer = null
+let plineTrufPolygon = null
+let plineTrufPline = null
+
+let regionTrufLayer = null
+let regionTrufRegion = null
+let regionTrufPolygon = null
+
+export default {
+ data () {
+ return {
+ pointShow: false,
+ plineShow: false,
+ regionShow: false
+ }
+ },
+ mounted () {
+ },
+ methods: {
+ closeModel () {
+ this.$router.push('/pcLayout/default')
+ },
+ loadPoint () {
+ pointTrufLayer = new global.DC.VectorLayer('pointTrufLayer')
+ global.viewer.addLayer(pointTrufLayer)
+ pointTrufPoint = new global.DC.Point('114.0415,27.6299,150')
+ pointTrufLayer.addOverlay(pointTrufPoint)
+ const coords = global.DC.GeoTools.pointBuffer('114.0415,27.6299', 50)
+ pointTrufPolygon = new global.DC.Polygon(coords)
+ pointTrufPolygon.setStyle({
+ material: global.DC.Color.RED.withAlpha(0.4)
+ })
+ pointTrufLayer.addOverlay(pointTrufPolygon)
+ global.viewer.flyTo(pointTrufLayer)
+ },
+ removePoint () {
+ pointTrufPoint != null && pointTrufLayer.removeOverlay(pointTrufPoint)
+ pointTrufPolygon != null && pointTrufLayer.removeOverlay(pointTrufPolygon)
+ pointTrufLayer != null && global.viewer.removeLayer(pointTrufLayer)
+ pointTrufPoint = null
+ pointTrufPolygon = null
+ pointTrufLayer = null
+ },
+ pointChange (e) {
+ if (e) {
+ this.loadPoint()
+ } else {
+ this.removePoint()
+ }
+ },
+ loadPline () {
+ plineTrufLayer = new global.DC.VectorLayer('plineTrufLayer')
+ global.viewer.addLayer(plineTrufLayer)
+ plineTrufPline = new global.DC.Polyline('114.0411,27.62997062,152;114.0418,27.62997062,152')
+ plineTrufPline.setStyle({
+ width: 2,
+ material: global.DC.Color.YELLOW,
+ zIndex: 1
+ })
+ plineTrufLayer.addOverlay(plineTrufPline)
+ const coords = global.DC.GeoTools.polylineBuffer('114.0411,27.62997062;114.0418,27.62997062', 50)
+ plineTrufPolygon = new global.DC.Polygon(coords)
+ plineTrufPolygon.setStyle({
+ material: global.DC.Color.RED.withAlpha(0.4)
+ })
+ plineTrufLayer.addOverlay(plineTrufPolygon)
+ global.viewer.flyTo(plineTrufLayer)
+ },
+ removePline () {
+ plineTrufPline != null && plineTrufLayer.removeOverlay(plineTrufPline)
+ plineTrufPolygon != null && plineTrufLayer.removeOverlay(plineTrufPolygon)
+ plineTrufLayer != null && global.viewer.removeLayer(plineTrufLayer)
+ plineTrufPline = null
+ plineTrufPolygon = null
+ plineTrufLayer = null
+ },
+ plineChange (e) {
+ if (e) {
+ this.loadPline()
+ } else {
+ this.removePline()
+ }
+ },
+ loadRegion () {
+ regionTrufLayer = new global.DC.VectorLayer('regionTrufLayer')
+ global.viewer.addLayer(regionTrufLayer)
+ regionTrufRegion = new global.DC.Polygon('114.0410,27.6299,152;114.0418,27.6312,152;114.0426,27.6299,152')
+ regionTrufRegion.setStyle({
+ zIndex: 1,
+ material: global.DC.Color.YELLOW
+ })
+ regionTrufLayer.addOverlay(regionTrufRegion)
+ const coords = global.DC.GeoTools.polygonBuffer('114.0410,27.6299;114.0415,27.6312;114.0426,27.6299', 150)
+ regionTrufPolygon = new global.DC.Polygon(coords)
+ regionTrufPolygon.setStyle({
+ material: global.DC.Color.RED.withAlpha(0.4)
+ })
+ regionTrufLayer.addOverlay(regionTrufPolygon)
+ global.viewer.flyTo(regionTrufLayer)
+ },
+ removeRegion () {
+ regionTrufRegion != null && regionTrufLayer.removeOverlay(regionTrufRegion)
+ regionTrufPolygon != null && regionTrufLayer.removeOverlay(regionTrufPolygon)
+ regionTrufLayer != null && global.viewer.removeLayer(regionTrufLayer)
+ regionTrufRegion = null
+ regionTrufPolygon = null
+ regionTrufLayer = null
+ },
+ regionChange (e) {
+ if (e) {
+ this.loadRegion()
+ } else {
+ this.removeRegion()
+ }
+ }
+ },
+ destroyed () {
+ this.removePoint()
+ this.removePline()
+ this.removeRegion()
+ }
+}
+</script>
+
+<style lang="sass" scoped>
+.move
+ cursor: move
+</style>
diff --git a/src/router/page/index.js b/src/router/page/index.js
index a3e8199..21e26d8 100644
--- a/src/router/page/index.js
+++ b/src/router/page/index.js
@@ -2,7 +2,7 @@
* @Author: Morpheus
* @Date: 2021-04-30 14:12:09
* @Last Modified by: Morpheus
- * @Last Modified time: 2022-04-20 09:54:54
+ * @Last Modified time: 2022-04-28 11:55:30
*/
import Vue from 'vue'
@@ -60,6 +60,7 @@
const pcTechniqueMapData = () => import('../../pcviews/technique/map.vue')
const pcTechniqueVideo = () => import('../../pcviews/technique/video.vue')
const pcTechniqueData = () => import('../../pcviews/technique/data.vue')
+const pcTechniqueTurf = () => import('../../pcviews/technique/turf.vue')
const pcTechniqueSpace = () => import('../../pcviews/technique/space.vue')
const pcTechniqueGraph = () => import('../../pcviews/technique/graph.vue')
const pcTechniquePath = () => import('../../pcviews/technique/path.vue')
@@ -393,6 +394,13 @@
}
},
{
+ path: 'turf',
+ component: pcTechniqueTurf,
+ meta: {
+ title: 'turf计算'
+ }
+ },
+ {
path: 'space',
component: pcTechniqueSpace,
meta: {
--
Gitblit v1.9.3