From e005b8711f2b92bc11ad348a0a2f0a82cd148047 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Tue, 23 Aug 2022 11:42:33 +0800
Subject: [PATCH] 农场标题样式
---
src/components/map/index.vue | 45 +++++++++++++++++++++++----------------------
1 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index b5b8fae..422fd13 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -4,7 +4,8 @@
</template>
<script>
-import axios from 'axios'
+// import axios from 'axios'
+import NCregion from "@/assets/region"
// 图层变量做声明
var farmRegionLayer = null
@@ -212,35 +213,35 @@
}
global.DC.ready(initViewer)
-
- this.addRegionPolyLine('http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengfwx/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson')
+ // this.addRegionPolyLine('http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengfwx/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson')
+ this.addRegionPolyLine(NCregion)
},
methods: {
/**
* 添加南城县边界的数据
* @param {string} url arcgis服务地址
*/
- addRegionPolyLine (url) {
- axios.get(url).then(res => {
- let position = ''
+ addRegionPolyLine (regionJSON) {
+ // axios.get(regionJSON).then(res => {
+ let position = ''
- res.data.features[0].geometry.rings[0].forEach(item => {
- position += `${item[0]}, ${item[1]};`
- })
-
- console.log(position, 565656)
-
- const polyline = new global.DC.Polyline(position)
- polyline.setStyle({
- width: 4,
- material: global.DC.Namespace.Cesium.Color.fromBytes(
- 244, 157, 21,
- 200
- ),
- clampToGround: true
- })
- regionPolyLineLayer.addOverlay(polyline)
+ regionJSON.features[0].geometry.rings[0].forEach(item => {
+ position += `${item[0]}, ${item[1]};`
})
+
+ console.log(position, 565656)
+
+ const polyline = new global.DC.Polyline(position)
+ polyline.setStyle({
+ width: 4,
+ material: global.DC.Namespace.Cesium.Color.fromBytes(
+ 244, 157, 21,
+ 200
+ ),
+ clampToGround: true
+ })
+ regionPolyLineLayer.addOverlay(polyline)
+ // })
},
/**
* 添加农场点及范围的方法
--
Gitblit v1.9.3