diff --git a/common/helper.js b/common/helper.js
index a501d64..a959f92 100644
--- a/common/helper.js
+++ b/common/helper.js
@@ -13,7 +13,8 @@ import {
getLength
} from 'ol/sphere.js';
import {
- LineString
+ LineString,
+ Point
} from "ol/geom";
@@ -50,7 +51,8 @@ const formatLength = function(line) {
const generateStyle = (feature, {
fillOpt,
- strokeOpt
+ strokeOpt,
+ withNode
}) => {
let area = 0;
const geom = feature.getGeometry();
@@ -59,7 +61,7 @@ const generateStyle = (feature, {
area = formatArea(geom);
const lineString = new LineString(geom.getCoordinates()[0]);
const length = formatLength(lineString);
- lineStyle = new Style({
+ lineStyle = [new Style({
geometry: lineString,
text: new TextStyle({
text: length,
@@ -79,7 +81,17 @@ const generateStyle = (feature, {
"overflow": true,
"rotation": 0
})
- })
+ }), ...(withNode ? geom.getCoordinates()[0]?.map(coordinates => {
+ return new Style({
+ geometry: new Point(coordinates),
+ image: new CircleStyle({
+ fill: new Fill({
+ color: '#0ff'
+ }),
+ radius: 2
+ })
+ })
+ }) : [])]
}
return [new Style({
fill: new Fill({
@@ -103,7 +115,7 @@ const generateStyle = (feature, {
"overflow": true,
"rotation": 0
})
- }), lineStyle].filter(item => item);
+ }), ...(lineStyle || [])].filter(item => item);
}
const startMeasure = (map, callback) => {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 0c60b69..6825ce3 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -3,9 +3,9 @@
-
+
- 南
+ 南
@@ -147,7 +147,8 @@
token: '',
measureStatus: '',
currentClickLayerItem: null,
- xzgjPoints: []
+ xzgjPoints: [],
+ compassNum: 0
}
},
watch: {
@@ -193,6 +194,18 @@
xzgjPoints: this.xzgjPoints
}
})
+
+ this.compassHandler = res => {
+ console.log(res)
+ this.compassNum = res.direction;
+ }
+ uni.onCompassChange(this.compassHandler);
+ },
+ onShow() {
+ uni.startCompass()
+ },
+ onHide() {
+ uni.stopCompass();
},
methods: {
checkLayer(value) {
@@ -591,7 +604,8 @@
strokeOpt: {
color: '#ffcc33',
width: 2,
- }
+ },
+ withNode: true
})
feature.setStyle(style);
vectorLayer.getSource().addFeature(feature)
@@ -843,6 +857,7 @@
z-index: 1;
font-weight: bold;
font-size: 17px;
+ margin-top: 8px;
}
.btn-workbench {
diff --git a/pages/sjgl/sjgl.vue b/pages/sjgl/sjgl.vue
index e869f46..330a55f 100644
--- a/pages/sjgl/sjgl.vue
+++ b/pages/sjgl/sjgl.vue
@@ -2,7 +2,7 @@
+ @cancel="searchCancel" @confirm="search" v-model="searchValue">
@@ -63,6 +63,12 @@
this.searchVisible = true
},
methods: {
+ searchCancel() {
+ this.searchVisible = false;
+ this.searchValue = ''
+ this.datas = [];
+ this.requestData();
+ },
search(value) {
this.pageNum = 1;
this.datas = []
@@ -145,7 +151,14 @@
} else {
this.loadStatus = 'more'
}
+ } else {
+ this.datas = [];
+ this.loadStatus = 'no-more'
}
+ },
+ fail: err => {
+ this.datas = [];
+ this.loadStatus = 'no-more'
}
})
}