ry-vue-map 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +1 -1
- package/lib/ryui.common.js +467 -287
- package/lib/ryui.common.js.gz +0 -0
- package/lib/ryui.css +1 -1
- package/lib/ryui.umd.js +467 -287
- package/lib/ryui.umd.js.gz +0 -0
- package/lib/ryui.umd.min.js +4 -4
- package/lib/ryui.umd.min.js.gz +0 -0
- package/package.json +3 -2
- package/src/assets/moveMarker.png +0 -0
- package/src/assets/startpoint.png +0 -0
- package/src/assets/stoppoint.png +0 -0
- package/src/components/index.js +2 -1
- package/src/components/maps/models/ryLines/ryLines.js +73 -0
- package/src/components/maps/ryLines/index.js +7 -0
- package/src/components/maps/ryLines/src/index.vue +226 -0
- package/src/components/maps/ryMap/src/index.vue +1 -0
- package/src/components/maps/ryPolygons/src/index.vue +67 -67
- package/src/components/maps/ryUniMap/index.js +6 -0
- package/src/components/maps/ryUniMap/src/index.vue +351 -0
- package/src/components/maps/ryVectorMap/src/index.vue +4 -4
- package/src/router/index.js +3 -3
- package/src/utils/lMapServices.js +947 -924
- package/src/views/map/index.vue +220 -7
- package/src/views/map/lineData.js +19592 -0
- package/src/views/map/lineData2.js +3449 -0
package/lib/ryui.umd.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ry-vue-map",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "lib/ryui.umd.min.js",
|
|
6
6
|
"description": "ry公共组件库",
|
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
"axios": "~0.21.1",
|
|
36
36
|
"core-js": "~3.15.2",
|
|
37
37
|
"countup.js": "~2.0.7",
|
|
38
|
+
"dayjs": "^1.11.7",
|
|
38
39
|
"element-ui": "~2.15.6",
|
|
39
40
|
"nprogress": "~0.2.0",
|
|
40
41
|
"ol": "^6.14.1",
|
|
41
|
-
"ry-map": "^0.3.
|
|
42
|
+
"ry-map": "^0.3.3",
|
|
42
43
|
"vue": "~2.6.14",
|
|
43
44
|
"vue-router": "~3.5.2",
|
|
44
45
|
"vue-server-renderer": "^2.6.14",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/components/index.js
CHANGED
|
@@ -8,10 +8,11 @@ import RyClusters from './maps/ryClusters';
|
|
|
8
8
|
import RyClustersMarker from './maps/ryClustersMarker';
|
|
9
9
|
import RyPolygonGeo from './maps/ryPolygonGeo';
|
|
10
10
|
import RyVectorMap from './maps/ryVectorMap';
|
|
11
|
+
import RyLines from './maps/ryLines';
|
|
11
12
|
// import "./fonts/iconfont.css";
|
|
12
13
|
|
|
13
14
|
// 组件列表
|
|
14
|
-
const components = [ RyMap,RyCrossHair,RyMapTool, RyPolygon,RyPolygons,RyClusters, RyPolygonGeo, RyClustersMarker,RyVectorMap];
|
|
15
|
+
const components = [ RyMap,RyCrossHair,RyMapTool, RyPolygon,RyPolygons,RyClusters, RyPolygonGeo, RyClustersMarker,RyVectorMap,RyLines];
|
|
15
16
|
|
|
16
17
|
// 定义install
|
|
17
18
|
const install = (Vue, options) => {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import Base from './../base/base';
|
|
2
|
+
|
|
3
|
+
const _lineDto = {
|
|
4
|
+
color: 'red',
|
|
5
|
+
width: 2,
|
|
6
|
+
zIndex: 1,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default class LineDto extends Base {
|
|
10
|
+
|
|
11
|
+
// 折线数据
|
|
12
|
+
model = {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => null,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// 批量插入数据
|
|
18
|
+
linenIsert = {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => null,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// 是否根据bbox 设为中心点
|
|
24
|
+
isLineFit = {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// 追加点
|
|
30
|
+
lineAppend = {
|
|
31
|
+
type: Array,
|
|
32
|
+
default: () => [],
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
startMarkerDto = {
|
|
36
|
+
type: Object,
|
|
37
|
+
default: () => null,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// 结束marker数据结构
|
|
41
|
+
|
|
42
|
+
endMarkerDto = {
|
|
43
|
+
type: Object,
|
|
44
|
+
default: () => null
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// 轨迹回放中心点数据结构
|
|
48
|
+
|
|
49
|
+
moveMarkerDto = {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: () => null
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
clearLiens = {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
endMarkerPoint = {
|
|
62
|
+
type: Array,
|
|
63
|
+
default: () => []
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
lineDto = {
|
|
69
|
+
type: Object,
|
|
70
|
+
default: () => _lineDto
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
</template>
|
|
3
|
+
|
|
4
|
+
<script>
|
|
5
|
+
import {
|
|
6
|
+
Polyline,
|
|
7
|
+
LMarker,
|
|
8
|
+
getCenterPoint,
|
|
9
|
+
fitNew,
|
|
10
|
+
getLngAndLatMaxMin,
|
|
11
|
+
GPS,
|
|
12
|
+
AM,
|
|
13
|
+
} from 'ry-map';
|
|
14
|
+
import Dto from './../../models/ryLines/ryLines.js';
|
|
15
|
+
export default {
|
|
16
|
+
name: 'RyLines',
|
|
17
|
+
props: {
|
|
18
|
+
...new Dto(),
|
|
19
|
+
},
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
lines: null,
|
|
23
|
+
checkPoint: null,
|
|
24
|
+
bbox: [],
|
|
25
|
+
bboxGCJ02: [],
|
|
26
|
+
lastType: -1,
|
|
27
|
+
lastLinesDto: null,
|
|
28
|
+
moveMarker: null,
|
|
29
|
+
endMarker: null,
|
|
30
|
+
startMarker: null,
|
|
31
|
+
pineArr: [],
|
|
32
|
+
lastLineX: 0,
|
|
33
|
+
lastLineY: 0,
|
|
34
|
+
cachePointArr: new Array(),
|
|
35
|
+
drawingEnd: false,
|
|
36
|
+
isFist: true,
|
|
37
|
+
lastColor: null,
|
|
38
|
+
am: new AM()
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
watch: {
|
|
42
|
+
model(val) {
|
|
43
|
+
this.init();
|
|
44
|
+
},
|
|
45
|
+
linenIsert(val) {
|
|
46
|
+
if (!this.map || !val) return;
|
|
47
|
+
this._insertLineAndMarker(val);
|
|
48
|
+
},
|
|
49
|
+
gpsType(val) {
|
|
50
|
+
|
|
51
|
+
},
|
|
52
|
+
clearLiens(val) {
|
|
53
|
+
if (val) {
|
|
54
|
+
this.clearLine();
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
lineAppend(val) {
|
|
58
|
+
if (val.length > 0 && this.map) {
|
|
59
|
+
this.appendCoordinate(val);
|
|
60
|
+
this.setMarkerPoint(this.endMarker, val);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
created() {
|
|
65
|
+
this.init();
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
init() {
|
|
69
|
+
if (!this.map) return;
|
|
70
|
+
this.clearLine();
|
|
71
|
+
if (!this.model) return;
|
|
72
|
+
this.lastType = this.gpsType;
|
|
73
|
+
this._insertLineAndMarker(this.model);
|
|
74
|
+
},
|
|
75
|
+
_insertLineAndMarker(val) {
|
|
76
|
+
const color = val.color;
|
|
77
|
+
const arr = val.pointArr;
|
|
78
|
+
if (this.isLineFit) {
|
|
79
|
+
this.calculateLineBBOX(arr);
|
|
80
|
+
}
|
|
81
|
+
this.initMarker(arr[0]);
|
|
82
|
+
if (!val.isAppend || !this.pineArr.length) {
|
|
83
|
+
this._insertPoint(val);
|
|
84
|
+
const line = this.createPolyline(val);
|
|
85
|
+
const len = arr.length - 1;
|
|
86
|
+
this.setMarkerPoint(this.endMarker, arr[len]);
|
|
87
|
+
this.restLastData(arr);
|
|
88
|
+
this.pineArr.push(line);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
arr.forEach(r => {
|
|
92
|
+
this.appendCoordinate(r);
|
|
93
|
+
});
|
|
94
|
+
const len = arr.length - 1;
|
|
95
|
+
this.setMarkerPoint(this.endMarker, arr[len]);
|
|
96
|
+
this.restLastData(arr);
|
|
97
|
+
},
|
|
98
|
+
async calculateLineBBOX(arr) {
|
|
99
|
+
return await new Promise(r => {
|
|
100
|
+
arr.forEach(r => {
|
|
101
|
+
this.am.getLngAndLatMaxMin({
|
|
102
|
+
X: r[0],
|
|
103
|
+
Y: r[1]
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
const amGpsArr = this.am.getLngLats();
|
|
107
|
+
fitNew(this.map, [
|
|
108
|
+
[amGpsArr[0], amGpsArr[1]],
|
|
109
|
+
[amGpsArr[2], amGpsArr[3]]
|
|
110
|
+
]);
|
|
111
|
+
r();
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
initMarker(arr) {
|
|
115
|
+
|
|
116
|
+
if (!this.startMarkerDto && !this.endMarkerDto) return;
|
|
117
|
+
if (!this.startMarker && !this.endMarker) {
|
|
118
|
+
this.startMarker = this.createStartMarker(this.startMarkerDto, arr);
|
|
119
|
+
this.endMarker = this.createStartMarker(this.endMarkerDto);
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
setMarkerPoint(marker, points) {
|
|
123
|
+
if (marker && points.length > 1) {
|
|
124
|
+
marker.setPosition(points, this.gpsType);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
restLastData(arr) {
|
|
128
|
+
if (arr.length > 0) {
|
|
129
|
+
const [x, y] = arr[arr.length - 1];
|
|
130
|
+
this.lastLineX = x;
|
|
131
|
+
this.lastLineY = y;
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
_insertPoint(val) {
|
|
135
|
+
if (this.lastLineX > 0 && this.lastLineY > 0 && val) {
|
|
136
|
+
val.pointArr.unshift([this.lastLineX, this.lastLineY]);
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
createPolyline(polylineModel = {
|
|
140
|
+
color: 'rgb(0,0,255)',
|
|
141
|
+
width: 2,
|
|
142
|
+
pointArr: [],
|
|
143
|
+
zIndex: 1000,
|
|
144
|
+
}) {
|
|
145
|
+
return new Polyline({
|
|
146
|
+
...polylineModel,
|
|
147
|
+
type: this.gpsType
|
|
148
|
+
}, this.map);
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
createStartMarker({
|
|
152
|
+
offset,
|
|
153
|
+
url,
|
|
154
|
+
width,
|
|
155
|
+
height
|
|
156
|
+
}, points = []) {
|
|
157
|
+
const marker = new LMarker(url, width, height);
|
|
158
|
+
marker.setOffset(offset);
|
|
159
|
+
if (points.length) {
|
|
160
|
+
marker.setPosition(points, this.gpsType);
|
|
161
|
+
}
|
|
162
|
+
this.map.addOverlay(marker.getMarker());
|
|
163
|
+
return marker;
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
getLngLatGCJ02(pointArr) {
|
|
168
|
+
const arr = [];
|
|
169
|
+
pointArr.forEach(r => {
|
|
170
|
+
const {
|
|
171
|
+
lon,
|
|
172
|
+
lat
|
|
173
|
+
} = GPS.gcj_encrypt(r[0], r[1]);
|
|
174
|
+
arr.push([lon, lat]);
|
|
175
|
+
});
|
|
176
|
+
return arr;
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
removeLines() {
|
|
180
|
+
this.pineArr.forEach(val => {
|
|
181
|
+
val.removePolyline();
|
|
182
|
+
});
|
|
183
|
+
this.pineArr = [];
|
|
184
|
+
},
|
|
185
|
+
removeLineMarker() {
|
|
186
|
+
if (!this.map) return;
|
|
187
|
+
if (this.endMarker) {
|
|
188
|
+
this.map.removeOverlay(this.endMarker.getMarker());
|
|
189
|
+
}
|
|
190
|
+
if (this.startMarker) {
|
|
191
|
+
this.map.removeOverlay(this.startMarker.getMarker());
|
|
192
|
+
}
|
|
193
|
+
if (this.moveMarker) {
|
|
194
|
+
this.map.removeOverlay(this.moveMarker.getMarker());
|
|
195
|
+
}
|
|
196
|
+
this.moveMarker = null;
|
|
197
|
+
this.endMarker = null;
|
|
198
|
+
this.startMarker = null;
|
|
199
|
+
},
|
|
200
|
+
clearLine() {
|
|
201
|
+
this.removeLines();
|
|
202
|
+
this.removeLineMarker();
|
|
203
|
+
this.cachePointArr = [];
|
|
204
|
+
this.lastColor = null;
|
|
205
|
+
this.lastLineX = 0;
|
|
206
|
+
this.lastLineY = 0;
|
|
207
|
+
this.am = null;
|
|
208
|
+
this.am = new AM();
|
|
209
|
+
},
|
|
210
|
+
appendCoordinate(coordinate = []) {
|
|
211
|
+
if (!coordinate.length) return;
|
|
212
|
+
if (!this.pineArr.length) {
|
|
213
|
+
this._insertLineAndMarker({...this.lineDto,pointArr:[coordinate],isAppend: false});
|
|
214
|
+
};
|
|
215
|
+
const line = this.pineArr[this.pineArr.length - 1];
|
|
216
|
+
line.appendCoordinate(coordinate);
|
|
217
|
+
},
|
|
218
|
+
selectGPSAll(type) {
|
|
219
|
+
|
|
220
|
+
},
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
</script>
|
|
224
|
+
|
|
225
|
+
<style>
|
|
226
|
+
</style>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
CheckPoint,
|
|
8
8
|
getCenterPoint,
|
|
9
9
|
fitNew,
|
|
10
|
-
getLngAndLatMaxMin,
|
|
10
|
+
getLngAndLatMaxMin,
|
|
11
11
|
GPS,
|
|
12
12
|
} from 'ry-map';
|
|
13
13
|
import Dto from './../../models/ryPolygons/ryPolygons.js';
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
data() {
|
|
20
20
|
return {
|
|
21
21
|
bbox: [],
|
|
22
|
-
bboxMap: new Map(),
|
|
23
|
-
bboxGCJ02:[],
|
|
22
|
+
bboxMap: new Map(),
|
|
23
|
+
bboxGCJ02:[],
|
|
24
24
|
bboxMapGCJ02: new Map(),
|
|
25
25
|
polygonMap: new Map(),
|
|
26
|
-
checkPointMap: new Map(),
|
|
27
|
-
isCreate:true,
|
|
26
|
+
checkPointMap: new Map(),
|
|
27
|
+
isCreate:true,
|
|
28
28
|
lastType:-1,
|
|
29
29
|
};
|
|
30
30
|
},
|
|
@@ -124,11 +124,11 @@
|
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
gpsType(val){
|
|
127
|
-
if(this.lastType == val) return;
|
|
128
|
-
this.gpsType=val;
|
|
127
|
+
if(this.lastType == val) return;
|
|
128
|
+
this.gpsType=val;
|
|
129
129
|
this.lastType=val;
|
|
130
130
|
this.selectGPSAll(this.gpsType);
|
|
131
|
-
},
|
|
131
|
+
},
|
|
132
132
|
|
|
133
133
|
},
|
|
134
134
|
created() {
|
|
@@ -181,16 +181,16 @@
|
|
|
181
181
|
this.polygonMap.set(val.id, polygon);
|
|
182
182
|
}
|
|
183
183
|
},
|
|
184
|
-
selectGPSAll(type){
|
|
184
|
+
selectGPSAll(type){
|
|
185
185
|
|
|
186
|
-
this.polygonMap.forEach(val=> {
|
|
187
|
-
val.selectGPS(type);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
this.checkPointMap.forEach(val => {
|
|
191
|
-
val.selectGPS(type);
|
|
186
|
+
this.polygonMap.forEach(val=> {
|
|
187
|
+
val.selectGPS(type);
|
|
192
188
|
});
|
|
193
|
-
|
|
189
|
+
|
|
190
|
+
this.checkPointMap.forEach(val => {
|
|
191
|
+
val.selectGPS(type);
|
|
192
|
+
});
|
|
193
|
+
},
|
|
194
194
|
|
|
195
195
|
initCheckPoint(val, center) {
|
|
196
196
|
if (!this.checkPointMap.has(val.id) && val.text) {
|
|
@@ -202,11 +202,11 @@
|
|
|
202
202
|
if (!this.bboxMap.has(id)) {
|
|
203
203
|
this.bbox.push(bbox);
|
|
204
204
|
this.bboxMap.set(id, bbox);
|
|
205
|
-
}
|
|
206
|
-
if(!this.bboxMapGCJ02.has(id)){
|
|
207
|
-
const _bboxGCJ02 =this.convertBBoxGCJ02(bbox);
|
|
208
|
-
this.bboxGCJ02.push(_bboxGCJ02);
|
|
209
|
-
this.bboxMapGCJ02.set(id,_bboxGCJ02);
|
|
205
|
+
}
|
|
206
|
+
if(!this.bboxMapGCJ02.has(id)){
|
|
207
|
+
const _bboxGCJ02 =this.convertBBoxGCJ02(bbox);
|
|
208
|
+
this.bboxGCJ02.push(_bboxGCJ02);
|
|
209
|
+
this.bboxMapGCJ02.set(id,_bboxGCJ02);
|
|
210
210
|
}
|
|
211
211
|
},
|
|
212
212
|
setFit() {
|
|
@@ -289,8 +289,8 @@
|
|
|
289
289
|
this.checkPointMap.clear();
|
|
290
290
|
this.polygonMap.clear();
|
|
291
291
|
this.bboxMap.clear();
|
|
292
|
-
this.bbox = [];
|
|
293
|
-
this.bboxGCJ02=[];
|
|
292
|
+
this.bbox = [];
|
|
293
|
+
this.bboxGCJ02=[];
|
|
294
294
|
this.bboxMapGCJ02.clear();
|
|
295
295
|
},
|
|
296
296
|
|
|
@@ -374,13 +374,13 @@
|
|
|
374
374
|
}
|
|
375
375
|
},
|
|
376
376
|
restBBOXArr() {
|
|
377
|
-
this.bbox = [];
|
|
377
|
+
this.bbox = [];
|
|
378
378
|
this.bboxGCJ02=[];
|
|
379
379
|
this.bboxMap.forEach(val => {
|
|
380
380
|
this.bbox.push(val);
|
|
381
|
-
});
|
|
382
|
-
this.bboxMapGCJ02.forEach(val => {
|
|
383
|
-
this.bboxGCJ02.push(val);
|
|
381
|
+
});
|
|
382
|
+
this.bboxMapGCJ02.forEach(val => {
|
|
383
|
+
this.bboxGCJ02.push(val);
|
|
384
384
|
});
|
|
385
385
|
},
|
|
386
386
|
removePolygonsAndCheckPoints(ids) {
|
|
@@ -409,23 +409,23 @@
|
|
|
409
409
|
|
|
410
410
|
if (this.bboxMap.has(id)) {
|
|
411
411
|
this.bboxMap.delete(id);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
if (this.bboxMapGCJ02.has(id)) {
|
|
415
|
-
this.bboxMapGCJ02.delete(id);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (this.bboxMapGCJ02.has(id)) {
|
|
415
|
+
this.bboxMapGCJ02.delete(id);
|
|
416
416
|
}
|
|
417
417
|
},
|
|
418
418
|
_ranges(ids) {
|
|
419
419
|
const arr = [];
|
|
420
|
-
ids.forEach(val => {
|
|
420
|
+
ids.forEach(val => {
|
|
421
421
|
|
|
422
422
|
if (this.bboxMap.has(val) && this.gpsType!=1) {
|
|
423
423
|
const bbox = this.bboxMap.get(val);
|
|
424
424
|
arr.push(bbox);
|
|
425
|
-
}else if (this.bboxMapGCJ02.has(val) && this.gpsType==1){
|
|
426
|
-
const bbox = this.bboxMapGCJ02.get(val);
|
|
427
|
-
arr.push(bbox);
|
|
428
|
-
}
|
|
425
|
+
}else if (this.bboxMapGCJ02.has(val) && this.gpsType==1){
|
|
426
|
+
const bbox = this.bboxMapGCJ02.get(val);
|
|
427
|
+
arr.push(bbox);
|
|
428
|
+
}
|
|
429
429
|
|
|
430
430
|
});
|
|
431
431
|
if (arr.length) {
|
|
@@ -437,9 +437,9 @@
|
|
|
437
437
|
if (this.bboxMap.has(id) && this.gpsType!=1) {
|
|
438
438
|
const bbox = this.bboxMap.get(id);
|
|
439
439
|
fitNew(this.map, [bbox]);
|
|
440
|
-
}else if(this.bboxMapGCJ02.has(id) && this.gpsType==1){
|
|
441
|
-
const bbox = this.bboxMapGCJ02.get(id);
|
|
442
|
-
fitNew(this.map, [bbox]);
|
|
440
|
+
}else if(this.bboxMapGCJ02.has(id) && this.gpsType==1){
|
|
441
|
+
const bbox = this.bboxMapGCJ02.get(id);
|
|
442
|
+
fitNew(this.map, [bbox]);
|
|
443
443
|
}
|
|
444
444
|
},
|
|
445
445
|
_insert(val, isLoad) {
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
}
|
|
464
464
|
},
|
|
465
465
|
// 批量插入多边形
|
|
466
|
-
_inserts(arr) {
|
|
466
|
+
_inserts(arr) {
|
|
467
467
|
this.lastType=this.gpsType;
|
|
468
468
|
arr.forEach(val => {
|
|
469
469
|
this._insert(val, false);
|
|
@@ -476,26 +476,26 @@
|
|
|
476
476
|
this.$emit('onLoad', {
|
|
477
477
|
polygonMap: this.polygonMap,
|
|
478
478
|
checkPointMap: this.checkPointMap,
|
|
479
|
-
bboxMap: this.bboxMap,
|
|
479
|
+
bboxMap: this.bboxMap,
|
|
480
480
|
bboxMapGCJ02:this.bboxMapGCJ02
|
|
481
481
|
});
|
|
482
482
|
},
|
|
483
483
|
_restFit() {
|
|
484
|
-
let bbox = [];
|
|
485
|
-
if(this.gpsType !=1){
|
|
486
|
-
this.bboxMap.forEach((val, key) => {
|
|
487
|
-
if (this.isShowPolygons.findIndex(r => r.id == key) === -1) {
|
|
488
|
-
bbox.push(this.bboxMap.get(key));
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
}else if(this.gpsType ==1){
|
|
492
|
-
this.bboxMapGCJ02.forEach((val, key) => {
|
|
493
|
-
if (this.isShowPolygons.findIndex(r => r.id == key) === -1) {
|
|
494
|
-
bbox.push(this.bboxMapGCJ02.get(key));
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
|
|
484
|
+
let bbox = [];
|
|
485
|
+
if(this.gpsType !=1){
|
|
486
|
+
this.bboxMap.forEach((val, key) => {
|
|
487
|
+
if (this.isShowPolygons.findIndex(r => r.id == key) === -1) {
|
|
488
|
+
bbox.push(this.bboxMap.get(key));
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
}else if(this.gpsType ==1){
|
|
492
|
+
this.bboxMapGCJ02.forEach((val, key) => {
|
|
493
|
+
if (this.isShowPolygons.findIndex(r => r.id == key) === -1) {
|
|
494
|
+
bbox.push(this.bboxMapGCJ02.get(key));
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
|
|
499
499
|
|
|
500
500
|
if (bbox.length) {
|
|
501
501
|
if(bbox.length > 1){
|
|
@@ -504,17 +504,17 @@
|
|
|
504
504
|
this.setFitFist(bbox[0]);
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
},
|
|
508
|
-
convertBBoxGCJ02(bbox){
|
|
509
|
-
const pointArr= [];
|
|
510
|
-
const { lat, lon } = GPS.gcj_encrypt(bbox[0], bbox[1]);
|
|
511
|
-
const { lon:lon2, lat:lat2 }= GPS.gcj_encrypt(bbox[2], bbox[3]);
|
|
512
|
-
pointArr.push(lon);
|
|
513
|
-
pointArr.push(lat);
|
|
514
|
-
pointArr.push(lon2);
|
|
515
|
-
pointArr.push(lat2);
|
|
516
|
-
return pointArr;
|
|
517
|
-
},
|
|
507
|
+
},
|
|
508
|
+
convertBBoxGCJ02(bbox){
|
|
509
|
+
const pointArr= [];
|
|
510
|
+
const { lat, lon } = GPS.gcj_encrypt(bbox[0], bbox[1]);
|
|
511
|
+
const { lon:lon2, lat:lat2 }= GPS.gcj_encrypt(bbox[2], bbox[3]);
|
|
512
|
+
pointArr.push(lon);
|
|
513
|
+
pointArr.push(lat);
|
|
514
|
+
pointArr.push(lon2);
|
|
515
|
+
pointArr.push(lat2);
|
|
516
|
+
return pointArr;
|
|
517
|
+
},
|
|
518
518
|
|
|
519
519
|
},
|
|
520
520
|
}
|