|
@@ -3,7 +3,7 @@
|
|
|
* @Author: wangcc
|
|
|
* @Date: 2022-10-19 09:32:46
|
|
|
* @LastEditors: wangcc
|
|
|
- * @LastEditTime: 2022-11-02 13:59:55
|
|
|
+ * @LastEditTime: 2022-11-02 14:24:57
|
|
|
* @FilePath: \castgroup_bigscreen\src\components\amapPow.vue
|
|
|
* @Copyright: Copyright (c) 2016~2022 by wangcc, All Rights Reserved.
|
|
|
-->
|
|
@@ -194,16 +194,29 @@ export default {
|
|
|
} else {
|
|
|
this.map.remove(this.projectSmallClassArr);
|
|
|
}
|
|
|
+
|
|
|
if (val != 'forest') {
|
|
|
this.map.remove(this.forestMarkerArr);
|
|
|
this.map.remove(this.smallClassNArr);
|
|
|
this.map.remove(this.smallClassPolygonArr);
|
|
|
this.map.remove(this.projectMarkerArr);
|
|
|
+ if (this.projectPolygonArr) {
|
|
|
+ this.map.remove(this.projectPolygonArr);
|
|
|
+ }
|
|
|
+ if (this.smallMarkers) {
|
|
|
+ this.map.remove(this.smallMarkers);
|
|
|
+ }
|
|
|
}
|
|
|
if (val != 'treeSpecies') {
|
|
|
this.map.remove(this.forestMarkerArr);
|
|
|
this.map.remove(this.treesPolygonArr);
|
|
|
this.map.remove(this.projectMarkerArr);
|
|
|
+ if (this.treeCompMarkers) {
|
|
|
+ this.map.remove(this.treeCompMarkers);
|
|
|
+ }
|
|
|
+ if (this.treesPolygonArr) {
|
|
|
+ this.map.remove(this.treesPolygonArr);
|
|
|
+ }
|
|
|
}
|
|
|
if (val != 'economics') {
|
|
|
this.map.remove(this.economicsArr);
|
|
@@ -442,7 +455,7 @@ export default {
|
|
|
text: ' ',
|
|
|
textAlign: 'center',
|
|
|
verticalAlign: 'middle', //middle 、bottom
|
|
|
- draggable: true,
|
|
|
+ draggable: false,
|
|
|
cursor: 'pointer',
|
|
|
angle: 2,
|
|
|
style: {
|
|
@@ -495,7 +508,7 @@ export default {
|
|
|
});
|
|
|
_this.setMapLabel(detail);
|
|
|
} else if (this.leftPage == 'treeSpecies') {
|
|
|
- this.addTreeSpeciesPolygon(detail)
|
|
|
+ this.addTreeSpeciesPolygon(detail);
|
|
|
// this.forestMarker.setLabel({
|
|
|
// direction: 'top',
|
|
|
// offset: new AMap.Pixel(0, 8), //设置文本标注偏移量
|
|
@@ -1324,7 +1337,7 @@ export default {
|
|
|
// ) {
|
|
|
// this.getRightScrollData(this.leftPage);
|
|
|
// }
|
|
|
- // } else
|
|
|
+ // } else
|
|
|
if (this.leftPage === 'economics') {
|
|
|
this.getEconomics();
|
|
|
} else if (this.leftPage === 'event') {
|
|
@@ -1644,57 +1657,57 @@ export default {
|
|
|
if (item.longitude && item.latitude) {
|
|
|
var lanLatArr = [];
|
|
|
// polygon.on('click', (e) => {
|
|
|
- lanLatArr = [item.longitude, item.latitude];
|
|
|
- let treeSmallLabel =
|
|
|
- "<div class='info-small'>" +
|
|
|
- "<h5 class='marker-title'>小班" +
|
|
|
- item.smallNumber +
|
|
|
- '</h5>' +
|
|
|
- "<div class='marker-content'>" +
|
|
|
- '<p>树种组成:' +
|
|
|
- item.treeComp +
|
|
|
- '</p>' +
|
|
|
- '<p>树种结构:' +
|
|
|
- item.treeStruct +
|
|
|
- '</p>' +
|
|
|
- '<p>优势树种:' +
|
|
|
- item.superTree +
|
|
|
- '</p>' +
|
|
|
- '<p>优势树种平均胸径:' +
|
|
|
- item.superTreeDbh +
|
|
|
- '厘米' +
|
|
|
- '</p>' +
|
|
|
- '<p>优势树种平均高:' +
|
|
|
- item.superTreeHigh +
|
|
|
- '米' +
|
|
|
- '</p>' +
|
|
|
- '<p>位置:' +
|
|
|
- item.countyName +
|
|
|
- item.townName +
|
|
|
- item.villageName +
|
|
|
- '</p>' +
|
|
|
- '</div>' +
|
|
|
- '</div>';
|
|
|
- that.smallMarker = new AMap.Marker({
|
|
|
- map: that.map,
|
|
|
- position: lanLatArr,
|
|
|
- icon: require('@/assets/img/small-marker.png'),
|
|
|
- anchor: 'bottom-center',
|
|
|
- offset: new AMap.Pixel(0, 0)
|
|
|
- });
|
|
|
- that.smallMarker.setLabel({
|
|
|
- direction: 'top',
|
|
|
- offset: new AMap.Pixel(-10, 0), //设置文本标注偏移量
|
|
|
- content: treeSmallLabel //设置文本标注内容
|
|
|
- });
|
|
|
- that.treeCompMarkers.push(that.smallMarker);
|
|
|
+ lanLatArr = [item.longitude, item.latitude];
|
|
|
+ let treeSmallLabel =
|
|
|
+ "<div class='info-small'>" +
|
|
|
+ "<h5 class='marker-title'>小班" +
|
|
|
+ item.smallNumber +
|
|
|
+ '</h5>' +
|
|
|
+ "<div class='marker-content'>" +
|
|
|
+ '<p>树种组成:' +
|
|
|
+ item.treeComp +
|
|
|
+ '</p>' +
|
|
|
+ '<p>树种结构:' +
|
|
|
+ item.treeStruct +
|
|
|
+ '</p>' +
|
|
|
+ '<p>优势树种:' +
|
|
|
+ item.superTree +
|
|
|
+ '</p>' +
|
|
|
+ '<p>优势树种平均胸径:' +
|
|
|
+ item.superTreeDbh +
|
|
|
+ '厘米' +
|
|
|
+ '</p>' +
|
|
|
+ '<p>优势树种平均高:' +
|
|
|
+ item.superTreeHigh +
|
|
|
+ '米' +
|
|
|
+ '</p>' +
|
|
|
+ '<p>位置:' +
|
|
|
+ item.countyName +
|
|
|
+ item.townName +
|
|
|
+ item.villageName +
|
|
|
+ '</p>' +
|
|
|
+ '</div>' +
|
|
|
+ '</div>';
|
|
|
+ that.smallMarker = new AMap.Marker({
|
|
|
+ map: that.map,
|
|
|
+ position: lanLatArr,
|
|
|
+ icon: require('@/assets/img/small-marker.png'),
|
|
|
+ anchor: 'bottom-center',
|
|
|
+ offset: new AMap.Pixel(0, 0)
|
|
|
+ });
|
|
|
+ that.smallMarker.setLabel({
|
|
|
+ direction: 'top',
|
|
|
+ offset: new AMap.Pixel(-10, 0), //设置文本标注偏移量
|
|
|
+ content: treeSmallLabel //设置文本标注内容
|
|
|
+ });
|
|
|
+ that.treeCompMarkers.push(that.smallMarker);
|
|
|
// });
|
|
|
that.map.on('rightclick', function (e) {
|
|
|
- if (that.treeCompMarkers.length > 0) {
|
|
|
+ if (that.treeCompMarkers) {
|
|
|
that.map.remove(that.treeCompMarkers);
|
|
|
}
|
|
|
if (that.treesPolygonArr) {
|
|
|
- that.map.remove(that.treesPolygonArr)
|
|
|
+ that.map.remove(that.treesPolygonArr);
|
|
|
}
|
|
|
});
|
|
|
}
|