ry-vue-map 0.2.3 → 0.2.6
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 +34057 -29071
- package/lib/ryui.common.js.gz +0 -0
- package/lib/ryui.css +1 -1
- package/lib/ryui.umd.js +34057 -29071
- package/lib/ryui.umd.js.gz +0 -0
- package/lib/ryui.umd.min.js +5 -5
- package/lib/ryui.umd.min.js.gz +0 -0
- package/package.json +2 -2
- package/src/components/index.js +4 -1
- package/src/components/maps/models/ryKML/index.js +29 -0
- package/src/components/maps/models/ryKMLs/index.js +41 -0
- package/src/components/maps/models/ryOfflineMap/map.js +140 -0
- package/src/components/maps/models/ryOfflineMap/view.js +62 -0
- package/src/components/maps/ryKML/index.js +7 -0
- package/src/components/maps/ryKML/src/index.vue +174 -0
- package/src/components/maps/ryKMLs/index.js +7 -0
- package/src/components/maps/ryKMLs/src/index.vue +217 -0
- package/src/components/maps/ryOfflineMap/index.js +6 -0
- package/src/components/maps/ryOfflineMap/src/index.vue +329 -0
- package/src/components/maps/switchMap/src/newIndex.vue +1 -1
- package/src/main.js +10 -8
- package/src/utils/lMapServices.js +48 -24
- package/src/views/map/330112.js +220 -0
- package/src/views/map/index.vue +73 -91
- package/src/views/map/index3.vue +207 -0
- package/src/views/map/index4.vue +207 -0
- package/src/views/map/indexStatic.vue +205 -0
- package/src/views/staticMap/index.vue +0 -1
- package/src/views/vectorMap/index.vue +2 -2
package/src/views/map/index.vue
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="map-style">
|
|
3
3
|
|
|
4
|
-
<ry-map projection="EPSG:4326" :zoom="15" :minZoom="1" :maxZoom="maxZoom" :center="center"
|
|
5
|
-
|
|
6
|
-
:bindMapClick="true"
|
|
4
|
+
<ry-map projection="EPSG:4326" :zoom="15" :minZoom="1" :maxZoom="maxZoom" :center="center" @load="load($event)"
|
|
5
|
+
:isCrossHair="isRyMapTool" :isRight="true" :isRyMapTool="true" @drawSuccess="drawSuccess"
|
|
6
|
+
@drawError="drawError" :isShowRangingTool="true" :isShowDrawTool="isRyMapTool" :bindMapClick="true"
|
|
7
7
|
@mapClick="mapClick($event)" @crossHairClick="crossHairClick($event)" :bindMapMoveend="true"
|
|
8
8
|
:isSwitchMapRight='true' :switchMapPosTop='60' :switchMapPosLeftOrRight="20" :switchMapHeight="40"
|
|
9
9
|
:switchMapDefaultTypeOrLayer="[1,2]" @mapMoveend="mapMoveend($event)"
|
|
10
|
-
@loadDrawPolygonEvent="loadDrawPolygonEvent($event)"
|
|
10
|
+
@loadDrawPolygonEvent="loadDrawPolygonEvent($event)"
|
|
11
11
|
@changeSwitchMap="changeSwitchMap($event)" :isShowSwitchMap="true"
|
|
12
12
|
>
|
|
13
13
|
<!-- <template slot="maptool">
|
|
@@ -23,43 +23,31 @@
|
|
|
23
23
|
<!-- :layerType="2"
|
|
24
24
|
:mapType="1" -->
|
|
25
25
|
<template #marker="{mapDto}">
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
<!-- <RyKMLs :map="mapDto.map" :gpsType="gpsType" :modelArr="kmls" ></RyKMLs> -->
|
|
27
|
+
<RyKML :map="mapDto.map" :gpsType="gpsType" :model="model" ></RyKML>
|
|
28
28
|
<!-- <ry-polygon :map="mapDto.map" :isShow="true" :polygonColor="colors" :model="polygonModel" :clear="isClear" @onLoad="onLoad($event)"></ry-polygon> -->
|
|
29
29
|
<!-- <ry-polygon :isFit="false" :gpsType="gpsType" :map="mapDto.map" :model="polygonModel"></ry-polygon> -->
|
|
30
30
|
<!-- <ry-polygon-geo :isFit="true" :gpsType="gpsType" :map="mapDto.map" :model="polygonModel6" > </ry-polygon-geo> -->
|
|
31
31
|
<!-- <ry-polygon :isFit="true" :isShowAll="isShowAll" :map="mapDto.map" :isShow="true" :model="polygonModel" @onLoad="onLoad($event)"></ry-polygon> -->
|
|
32
|
-
<!-- <ry-polygons :restFit="restFit" :isCheckPointHideAll="isShowAll" :isCheckPointHide="showPolygon"
|
|
33
|
-
:isCheckPointHides="showPolygons" :isShowPolygon="showPolygon" :isShowPolygons="showPolygons" :range="range"
|
|
34
|
-
:ranges="ranges" :insert="insert" :inserts="inserts" :isFit="isFit" :map="mapDto.map" :isShow="true"
|
|
35
|
-
:polygonColor="polygonColorObj" :remove="remove" :removes="removes" :polygonColors="polygonColors"
|
|
36
|
-
:modelArr="modelArr" @onLoad="onLoad($event)"></ry-polygons> -->
|
|
37
|
-
|
|
38
|
-
<!-- <ry-polygons
|
|
39
|
-
:map="mapDto.map"
|
|
40
|
-
v-if="modelArr.length"
|
|
41
|
-
:modelArr="modelArr"
|
|
42
|
-
@onLoad="onLoad($event)"
|
|
43
|
-
:isShowPolygon="showPolygon"
|
|
44
|
-
|
|
45
|
-
:inserts="inserts"
|
|
46
|
-
:gpsType="gpsType"></ry-polygons> -->
|
|
47
|
-
<ry-clusters
|
|
48
|
-
:src="src"
|
|
49
|
-
fontColor="red"
|
|
50
|
-
:fontSize="23"
|
|
51
|
-
:distance="200"
|
|
52
|
-
:gpsType="gpsType"
|
|
53
|
-
@callback="clusterCallback($event)"
|
|
54
|
-
:map="mapDto.map"
|
|
55
|
-
:modelArr="modelArr"
|
|
56
|
-
:offsetY="0"></ry-clusters>
|
|
57
32
|
|
|
58
33
|
</template>
|
|
59
34
|
|
|
60
35
|
</ry-map>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
<button @click="onClick()">测试</button>
|
|
39
|
+
<button @click="onClick2()">测试2</button>
|
|
40
|
+
<button @click="onClick3()">测试3</button>
|
|
61
41
|
|
|
42
|
+
<aside class="aside-style">
|
|
43
|
+
<el-button
|
|
44
|
+
class="ele-text-primary" v-show="isShowPaly" style="padding:10px;" @click.stop="onShowPaly(false)">
|
|
45
|
+
轨迹回放 </el-button>
|
|
62
46
|
|
|
47
|
+
<el-button
|
|
48
|
+
class="ele-text-primary" v-show="!isShowPaly" style="padding:10px; color: red;" @click.stop="onShowPaly(true)">
|
|
49
|
+
结束轨迹回放 </el-button>
|
|
50
|
+
</aside>
|
|
63
51
|
</div>
|
|
64
52
|
</template>
|
|
65
53
|
|
|
@@ -69,25 +57,39 @@
|
|
|
69
57
|
import RyMapTool from '@/components/maps/ryMapTool/src/index.vue';
|
|
70
58
|
import RyPolygon from '@/components/maps/ryPolygon/src/index.vue';
|
|
71
59
|
import RyPolygons from '@/components/maps/ryPolygons/src/index.vue';
|
|
72
|
-
import
|
|
60
|
+
import RyClustersMarker from '@/components/maps/ryClustersMarker/src/index.vue';
|
|
73
61
|
import RyPolygonGeo from '@/components/maps/ryPolygonGeo/src/index.vue';
|
|
74
|
-
import
|
|
75
|
-
|
|
76
|
-
import gJson2 from "./331123";
|
|
77
|
-
import gJson10 from "./330681";
|
|
62
|
+
import RyKMLs from '@/components/maps/ryKMLs/src/index.vue';
|
|
63
|
+
import RyKML from '@/components/maps/ryKML/src/index.vue';
|
|
78
64
|
import {
|
|
79
65
|
createPolygonBoundary,
|
|
80
66
|
GPS
|
|
81
67
|
} from "ry-map";
|
|
82
|
-
import dksj from './dksj.js';
|
|
83
|
-
// import lineData2 from './lineData2.js';
|
|
84
|
-
// import lineData2 from './lineData2.js';
|
|
85
|
-
|
|
86
|
-
// import { convertWGS84,convertGCJ02 } from "ry-map/src/lzh";
|
|
87
68
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
69
|
+
const kmls=[
|
|
70
|
+
{
|
|
71
|
+
"id": 4,
|
|
72
|
+
"url": "https://rydemo.ryaims.com:9443/ryfiles/31/a6ab6654b9f14a7c84af7289dda6636c.kml",
|
|
73
|
+
"gcj02Url": "https://rydemo.ryaims.com:9443/ryfiles/59/817d2f7752e54c9daa48dc1738871917.kml",
|
|
74
|
+
"bbox": [
|
|
75
|
+
121.91140167,
|
|
76
|
+
29.14645833,
|
|
77
|
+
121.920475,
|
|
78
|
+
29.16052167
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": 3,
|
|
83
|
+
"url": "https://rydemo.ryaims.com:9443/ryfiles/46/8c1e06765e0543cc9002b255fe41f372.kml",
|
|
84
|
+
"gcj02Url": "https://rydemo.ryaims.com:9443/ryfiles/80/2607c27c8da1408b8d8f4a9d6487eed1.kml",
|
|
85
|
+
"bbox": [
|
|
86
|
+
121.4692,
|
|
87
|
+
29.759945,
|
|
88
|
+
121.47069167,
|
|
89
|
+
29.761625
|
|
90
|
+
],
|
|
91
|
+
}
|
|
92
|
+
];
|
|
91
93
|
|
|
92
94
|
export default {
|
|
93
95
|
components: {
|
|
@@ -95,8 +97,10 @@
|
|
|
95
97
|
RyMapTool,
|
|
96
98
|
RyPolygon,
|
|
97
99
|
RyPolygons,
|
|
98
|
-
|
|
100
|
+
RyClustersMarker,
|
|
99
101
|
RyPolygonGeo,
|
|
102
|
+
RyKMLs,
|
|
103
|
+
RyKML
|
|
100
104
|
},
|
|
101
105
|
data() {
|
|
102
106
|
return {
|
|
@@ -107,14 +111,7 @@
|
|
|
107
111
|
isClear: false,
|
|
108
112
|
geoJson: null,
|
|
109
113
|
colors: [],
|
|
110
|
-
|
|
111
|
-
modelArr2: [
|
|
112
|
-
{id:'ceshi1', x:120.15535003220648,y:30.179378795342608},
|
|
113
|
-
{id:'ceshi2',x:120.16369976775891,y:30.1967116895034},
|
|
114
|
-
{id:'ceshi3',x:120.156817,y:30.1753985} ,
|
|
115
|
-
{id:'ceshi4',x:120.1538245,y:30.183076} ,
|
|
116
|
-
],
|
|
117
|
-
center: [ 120.2687149,29.8142052],
|
|
114
|
+
center: [ 121.482227,28.5327395],
|
|
118
115
|
polygonColors: [],
|
|
119
116
|
remove: 'ceshi1',
|
|
120
117
|
removes: [],
|
|
@@ -132,20 +129,15 @@
|
|
|
132
129
|
isShowAll: false,
|
|
133
130
|
// isShow:true,
|
|
134
131
|
polygonModel: null,
|
|
135
|
-
geo: g1,
|
|
136
132
|
mapTool: null,
|
|
137
133
|
isCheckPoint: null,
|
|
138
|
-
gpsType:
|
|
134
|
+
gpsType: 1,
|
|
139
135
|
isRyMapTool: true,
|
|
140
136
|
maxZoom: 18,
|
|
141
|
-
polygonModel5: polygonModel5,
|
|
142
|
-
polygonModel6:polygonModel6,
|
|
143
137
|
src:require("@/assets/1.png"),
|
|
144
138
|
lineData1:null,
|
|
145
139
|
lineData2:null,
|
|
146
140
|
clearLiens:false,
|
|
147
|
-
// startMarkerDto:null,
|
|
148
|
-
// endMarkerDto:null,
|
|
149
141
|
startMarkerDto: {
|
|
150
142
|
url:require('@/assets/startpoint.png'),
|
|
151
143
|
height:23,
|
|
@@ -161,27 +153,25 @@
|
|
|
161
153
|
lineAppend:[],
|
|
162
154
|
isShowPaly:true,
|
|
163
155
|
layerArr:[2,2],
|
|
156
|
+
kmls,
|
|
157
|
+
model:null
|
|
164
158
|
};
|
|
165
159
|
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
arr.push(_mode);
|
|
181
|
-
});
|
|
182
|
-
this.modelArr=arr;
|
|
160
|
+
created() {
|
|
161
|
+
// this.model={
|
|
162
|
+
// "id": 3,
|
|
163
|
+
// "url": "https://rydemo.ryaims.com:9443/ryfiles/46/8c1e06765e0543cc9002b255fe41f372.kml",
|
|
164
|
+
// "gcj02Url": "https://rydemo.ryaims.com:9443/ryfiles/80/2607c27c8da1408b8d8f4a9d6487eed1.kml",
|
|
165
|
+
// "bbox": [
|
|
166
|
+
// 121.4692,
|
|
167
|
+
// 29.759945,
|
|
168
|
+
// 121.47069167,
|
|
169
|
+
// 29.761625
|
|
170
|
+
// ],
|
|
171
|
+
// };
|
|
172
|
+
|
|
173
|
+
|
|
183
174
|
},
|
|
184
|
-
|
|
185
175
|
methods: {
|
|
186
176
|
onShowPaly(b) {
|
|
187
177
|
this.isShowPaly = b;
|
|
@@ -190,12 +180,6 @@
|
|
|
190
180
|
load(obj) {
|
|
191
181
|
this.lMap = obj.mapServices;
|
|
192
182
|
this.map = obj.map;
|
|
193
|
-
// console.log(obj);
|
|
194
|
-
// let g10 = GPS.convertGCJ02(gJson2);
|
|
195
|
-
// convertWGS84
|
|
196
|
-
// convertWGS84,convertGCJ02
|
|
197
|
-
// const geo = createPolygonBoundary(g5);
|
|
198
|
-
// this.map.addLayer(geo );
|
|
199
183
|
},
|
|
200
184
|
drawSuccess(obj) {
|
|
201
185
|
this.polygonModel = {
|
|
@@ -213,11 +197,10 @@
|
|
|
213
197
|
},
|
|
214
198
|
onLoad(e) {},
|
|
215
199
|
crossHairClick(e) {
|
|
216
|
-
|
|
200
|
+
|
|
217
201
|
},
|
|
218
202
|
mapMoveend(e) {
|
|
219
|
-
|
|
220
|
-
// console.log(e);
|
|
203
|
+
|
|
221
204
|
},
|
|
222
205
|
loadDrawPolygonEvent(e) {
|
|
223
206
|
this.mapTool = e;
|
|
@@ -226,16 +209,15 @@
|
|
|
226
209
|
id,
|
|
227
210
|
isShow
|
|
228
211
|
}) {
|
|
229
|
-
console.log(id);
|
|
230
212
|
setTimeout(r => {
|
|
231
213
|
this.showPolygon = {
|
|
232
214
|
id,
|
|
233
215
|
isShow
|
|
234
216
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
217
|
+
this.isCheckPoint = {
|
|
218
|
+
id,
|
|
219
|
+
isShow
|
|
220
|
+
};
|
|
239
221
|
}, 50);
|
|
240
222
|
},
|
|
241
223
|
changeSwitchMap(obj) {
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="map-style">
|
|
3
|
+
|
|
4
|
+
<ry-map projection="EPSG:4326" :zoom="10" :minZoom="1" :maxZoom="maxZoom" :center="center" @load="load($event)"
|
|
5
|
+
:isCrossHair="isRyMapTool" :isRight="true" :isRyMapTool="true" @drawSuccess="drawSuccess"
|
|
6
|
+
@drawError="drawError" :isShowRangingTool="true" :isShowDrawTool="isRyMapTool" :bindMapClick="true"
|
|
7
|
+
@mapClick="mapClick($event)" @crossHairClick="crossHairClick($event)" :bindMapMoveend="true"
|
|
8
|
+
@mapMoveend="mapMoveend($event)"
|
|
9
|
+
v-if="dto"
|
|
10
|
+
:boundaryModel="dto"
|
|
11
|
+
:urls="urls"
|
|
12
|
+
:bbox="bbox"
|
|
13
|
+
>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
</ry-map>
|
|
17
|
+
|
|
18
|
+
<button @click="onClick()">测试</button>
|
|
19
|
+
<button @click="onClick2()">测试2</button>
|
|
20
|
+
<button @click="onClick3()">测试3</button>
|
|
21
|
+
|
|
22
|
+
<aside class="aside-style">
|
|
23
|
+
<el-button
|
|
24
|
+
class="ele-text-primary" v-show="isShowPaly" style="padding:10px;" @click.stop="onShowPaly(false)">
|
|
25
|
+
轨迹回放 </el-button>
|
|
26
|
+
|
|
27
|
+
<el-button
|
|
28
|
+
class="ele-text-primary" v-show="!isShowPaly" style="padding:10px; color: red;" @click.stop="onShowPaly(true)">
|
|
29
|
+
结束轨迹回放 </el-button>
|
|
30
|
+
</aside>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
import dayjs from 'dayjs'
|
|
36
|
+
import RyMap from '@/components/maps/ryOfflineMap/src/index.vue';
|
|
37
|
+
import RyMapTool from '@/components/maps/ryMapTool/src/index.vue';
|
|
38
|
+
import RyPolygon from '@/components/maps/ryPolygon/src/index.vue';
|
|
39
|
+
import RyPolygons from '@/components/maps/ryPolygons/src/index.vue';
|
|
40
|
+
import RyClustersMarker from '@/components/maps/ryClustersMarker/src/index.vue';
|
|
41
|
+
import RyPolygonGeo from '@/components/maps/ryPolygonGeo/src/index.vue';
|
|
42
|
+
import geoJson from "./330112";
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
components: {
|
|
48
|
+
RyMap,
|
|
49
|
+
RyMapTool,
|
|
50
|
+
RyPolygon,
|
|
51
|
+
RyPolygons,
|
|
52
|
+
RyClustersMarker,
|
|
53
|
+
RyPolygonGeo,
|
|
54
|
+
},
|
|
55
|
+
data() {
|
|
56
|
+
return {
|
|
57
|
+
map: null,
|
|
58
|
+
lMap: null,
|
|
59
|
+
polygonColorObj: null,
|
|
60
|
+
// const bbox = [ 118.84072600000002, 29.937127000000032, 119.86315600000012, 30.445895000000064 ];
|
|
61
|
+
// const center = [119.34667114000006, 30.198078622500038];
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
bbox: [118.84072600000002, 29.937127000000032, 119.86315600000012, 30.445895000000064],
|
|
65
|
+
isClear: false,
|
|
66
|
+
colors: [],
|
|
67
|
+
modelArr2: [
|
|
68
|
+
{id:'ceshi1', x:120.15535003220648,y:30.179378795342608},
|
|
69
|
+
{id:'ceshi2',x:120.16369976775891,y:30.1967116895034},
|
|
70
|
+
{id:'ceshi3',x:120.156817,y:30.1753985} ,
|
|
71
|
+
{id:'ceshi4',x:120.1538245,y:30.183076} ,
|
|
72
|
+
],
|
|
73
|
+
center: [119.34667114000006, 30.198078622500038],
|
|
74
|
+
polygonColors: [],
|
|
75
|
+
remove: 'ceshi1',
|
|
76
|
+
removes: [],
|
|
77
|
+
ranges: [],
|
|
78
|
+
restFit: true,
|
|
79
|
+
range: 'ceshi2',
|
|
80
|
+
isFit: false,
|
|
81
|
+
insert: null,
|
|
82
|
+
showPolygon: null,
|
|
83
|
+
showPolygons: [{
|
|
84
|
+
id: 'ceshi2',
|
|
85
|
+
isShow: false
|
|
86
|
+
}],
|
|
87
|
+
inserts: [],
|
|
88
|
+
isShowAll: false,
|
|
89
|
+
polygonModel: null,
|
|
90
|
+
mapTool: null,
|
|
91
|
+
isCheckPoint: null,
|
|
92
|
+
gpsType: 0,
|
|
93
|
+
isRyMapTool: true,
|
|
94
|
+
maxZoom: 18,
|
|
95
|
+
lineData1:null,
|
|
96
|
+
lineData2:null,
|
|
97
|
+
clearLiens:false,
|
|
98
|
+
// startMarkerDto:null,
|
|
99
|
+
// endMarkerDto:null,
|
|
100
|
+
startMarkerDto: {
|
|
101
|
+
url:require('@/assets/startpoint.png'),
|
|
102
|
+
height:23,
|
|
103
|
+
offset:[8, -11],
|
|
104
|
+
width:28
|
|
105
|
+
},
|
|
106
|
+
endMarkerDto:{
|
|
107
|
+
url:require('@/assets/stoppoint.png'),
|
|
108
|
+
height:16,
|
|
109
|
+
offset:[0, -8],
|
|
110
|
+
width:16
|
|
111
|
+
},
|
|
112
|
+
lineAppend:[],
|
|
113
|
+
isShowPaly:true,
|
|
114
|
+
layerArr:[2,2],
|
|
115
|
+
urls:[
|
|
116
|
+
`http://127.0.0.1:10006/${330112}/satellite/{z}/{x}/{y}.jpg`,
|
|
117
|
+
`http://127.0.0.1:10006/${330112}/overlay/{z}/{x}/{y}.png`
|
|
118
|
+
],
|
|
119
|
+
dto:null,
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
created() {
|
|
123
|
+
this.dto={
|
|
124
|
+
geo:geoJson,
|
|
125
|
+
width:4,
|
|
126
|
+
color:'#000'
|
|
127
|
+
};
|
|
128
|
+
console.log(this.dto);
|
|
129
|
+
},
|
|
130
|
+
methods: {
|
|
131
|
+
onShowPaly(b) {
|
|
132
|
+
this.isShowPaly = b;
|
|
133
|
+
|
|
134
|
+
},
|
|
135
|
+
load(obj) {
|
|
136
|
+
this.lMap = obj.mapServices;
|
|
137
|
+
this.map = obj.map;
|
|
138
|
+
console.log(this.lMap);
|
|
139
|
+
|
|
140
|
+
},
|
|
141
|
+
drawSuccess(obj) {
|
|
142
|
+
this.polygonModel = {
|
|
143
|
+
fillColor: '#000',
|
|
144
|
+
stroke: '#fff',
|
|
145
|
+
width: 4,
|
|
146
|
+
text: '',
|
|
147
|
+
geo: obj.geoJson,
|
|
148
|
+
id: 'ceshi',
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
drawError(obj) {},
|
|
152
|
+
mapClick(e) {
|
|
153
|
+
// alert(e);
|
|
154
|
+
},
|
|
155
|
+
onLoad(e) {},
|
|
156
|
+
crossHairClick(e) {
|
|
157
|
+
// console.log(e);
|
|
158
|
+
},
|
|
159
|
+
mapMoveend(e) {
|
|
160
|
+
// alert(1);
|
|
161
|
+
// console.log(e);
|
|
162
|
+
},
|
|
163
|
+
loadDrawPolygonEvent(e) {
|
|
164
|
+
this.mapTool = e;
|
|
165
|
+
},
|
|
166
|
+
clusterCallback({
|
|
167
|
+
id,
|
|
168
|
+
isShow
|
|
169
|
+
}) {
|
|
170
|
+
setTimeout(r => {
|
|
171
|
+
this.showPolygon = {
|
|
172
|
+
id,
|
|
173
|
+
isShow
|
|
174
|
+
};
|
|
175
|
+
this.isCheckPoint = {
|
|
176
|
+
id,
|
|
177
|
+
isShow
|
|
178
|
+
};
|
|
179
|
+
}, 50);
|
|
180
|
+
},
|
|
181
|
+
changeSwitchMap(obj) {
|
|
182
|
+
if (obj.mapType == 2) {
|
|
183
|
+
this.gpsType = 0;
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
this.gpsType = obj.mapType;
|
|
187
|
+
},
|
|
188
|
+
onClick() {
|
|
189
|
+
this.isRyMapTool = !this.isRyMapTool;
|
|
190
|
+
},
|
|
191
|
+
onClick2() {
|
|
192
|
+
this.maxZoom = 28;
|
|
193
|
+
},
|
|
194
|
+
onClick3() {
|
|
195
|
+
this.maxZoom = 10;
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
</script>
|
|
201
|
+
|
|
202
|
+
<style lang="scss" scoped>
|
|
203
|
+
.map-style {
|
|
204
|
+
height: 100vh;
|
|
205
|
+
position: relative;
|
|
206
|
+
}
|
|
207
|
+
</style>
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="map-style">
|
|
3
|
+
|
|
4
|
+
<ry-map projection="EPSG:4326" :zoom="10" :minZoom="1" :maxZoom="maxZoom" :center="center" @load="load($event)"
|
|
5
|
+
:isCrossHair="isRyMapTool" :isRight="true" :isRyMapTool="true" @drawSuccess="drawSuccess"
|
|
6
|
+
@drawError="drawError" :isShowRangingTool="true" :isShowDrawTool="isRyMapTool" :bindMapClick="true"
|
|
7
|
+
@mapClick="mapClick($event)" @crossHairClick="crossHairClick($event)" :bindMapMoveend="true"
|
|
8
|
+
@mapMoveend="mapMoveend($event)"
|
|
9
|
+
v-if="dto"
|
|
10
|
+
:boundaryModel="dto"
|
|
11
|
+
:urls="urls"
|
|
12
|
+
:bbox="bbox"
|
|
13
|
+
>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
</ry-map>
|
|
17
|
+
|
|
18
|
+
<button @click="onClick()">测试</button>
|
|
19
|
+
<button @click="onClick2()">测试2</button>
|
|
20
|
+
<button @click="onClick3()">测试3</button>
|
|
21
|
+
|
|
22
|
+
<aside class="aside-style">
|
|
23
|
+
<el-button
|
|
24
|
+
class="ele-text-primary" v-show="isShowPaly" style="padding:10px;" @click.stop="onShowPaly(false)">
|
|
25
|
+
轨迹回放 </el-button>
|
|
26
|
+
|
|
27
|
+
<el-button
|
|
28
|
+
class="ele-text-primary" v-show="!isShowPaly" style="padding:10px; color: red;" @click.stop="onShowPaly(true)">
|
|
29
|
+
结束轨迹回放 </el-button>
|
|
30
|
+
</aside>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
import dayjs from 'dayjs'
|
|
36
|
+
import RyMap from '@/components/maps/ryOfflineMap/src/index.vue';
|
|
37
|
+
import RyMapTool from '@/components/maps/ryMapTool/src/index.vue';
|
|
38
|
+
import RyPolygon from '@/components/maps/ryPolygon/src/index.vue';
|
|
39
|
+
import RyPolygons from '@/components/maps/ryPolygons/src/index.vue';
|
|
40
|
+
import RyClustersMarker from '@/components/maps/ryClustersMarker/src/index.vue';
|
|
41
|
+
import RyPolygonGeo from '@/components/maps/ryPolygonGeo/src/index.vue';
|
|
42
|
+
import geoJson from "./330112";
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
components: {
|
|
48
|
+
RyMap,
|
|
49
|
+
RyMapTool,
|
|
50
|
+
RyPolygon,
|
|
51
|
+
RyPolygons,
|
|
52
|
+
RyClustersMarker,
|
|
53
|
+
RyPolygonGeo,
|
|
54
|
+
},
|
|
55
|
+
data() {
|
|
56
|
+
return {
|
|
57
|
+
map: null,
|
|
58
|
+
lMap: null,
|
|
59
|
+
polygonColorObj: null,
|
|
60
|
+
// const bbox = [ 118.84072600000002, 29.937127000000032, 119.86315600000012, 30.445895000000064 ];
|
|
61
|
+
// const center = [119.34667114000006, 30.198078622500038];
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
bbox: [118.84072600000002, 29.937127000000032, 119.86315600000012, 30.445895000000064],
|
|
65
|
+
isClear: false,
|
|
66
|
+
colors: [],
|
|
67
|
+
modelArr2: [
|
|
68
|
+
{id:'ceshi1', x:120.15535003220648,y:30.179378795342608},
|
|
69
|
+
{id:'ceshi2',x:120.16369976775891,y:30.1967116895034},
|
|
70
|
+
{id:'ceshi3',x:120.156817,y:30.1753985} ,
|
|
71
|
+
{id:'ceshi4',x:120.1538245,y:30.183076} ,
|
|
72
|
+
],
|
|
73
|
+
center: [119.34667114000006, 30.198078622500038],
|
|
74
|
+
polygonColors: [],
|
|
75
|
+
remove: 'ceshi1',
|
|
76
|
+
removes: [],
|
|
77
|
+
ranges: [],
|
|
78
|
+
restFit: true,
|
|
79
|
+
range: 'ceshi2',
|
|
80
|
+
isFit: false,
|
|
81
|
+
insert: null,
|
|
82
|
+
showPolygon: null,
|
|
83
|
+
showPolygons: [{
|
|
84
|
+
id: 'ceshi2',
|
|
85
|
+
isShow: false
|
|
86
|
+
}],
|
|
87
|
+
inserts: [],
|
|
88
|
+
isShowAll: false,
|
|
89
|
+
polygonModel: null,
|
|
90
|
+
mapTool: null,
|
|
91
|
+
isCheckPoint: null,
|
|
92
|
+
gpsType: 0,
|
|
93
|
+
isRyMapTool: true,
|
|
94
|
+
maxZoom: 18,
|
|
95
|
+
lineData1:null,
|
|
96
|
+
lineData2:null,
|
|
97
|
+
clearLiens:false,
|
|
98
|
+
// startMarkerDto:null,
|
|
99
|
+
// endMarkerDto:null,
|
|
100
|
+
startMarkerDto: {
|
|
101
|
+
url:require('@/assets/startpoint.png'),
|
|
102
|
+
height:23,
|
|
103
|
+
offset:[8, -11],
|
|
104
|
+
width:28
|
|
105
|
+
},
|
|
106
|
+
endMarkerDto:{
|
|
107
|
+
url:require('@/assets/stoppoint.png'),
|
|
108
|
+
height:16,
|
|
109
|
+
offset:[0, -8],
|
|
110
|
+
width:16
|
|
111
|
+
},
|
|
112
|
+
lineAppend:[],
|
|
113
|
+
isShowPaly:true,
|
|
114
|
+
layerArr:[2,2],
|
|
115
|
+
urls:[
|
|
116
|
+
`http://127.0.0.1:10006/${330112}/satellite/{z}/{x}/{y}.jpg`,
|
|
117
|
+
`http://127.0.0.1:10006/${330112}/overlay/{z}/{x}/{y}.png`
|
|
118
|
+
],
|
|
119
|
+
dto:null,
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
created() {
|
|
123
|
+
this.dto={
|
|
124
|
+
geo:geoJson,
|
|
125
|
+
width:4,
|
|
126
|
+
color:'#000'
|
|
127
|
+
};
|
|
128
|
+
console.log(this.dto);
|
|
129
|
+
},
|
|
130
|
+
methods: {
|
|
131
|
+
onShowPaly(b) {
|
|
132
|
+
this.isShowPaly = b;
|
|
133
|
+
|
|
134
|
+
},
|
|
135
|
+
load(obj) {
|
|
136
|
+
this.lMap = obj.mapServices;
|
|
137
|
+
this.map = obj.map;
|
|
138
|
+
console.log(this.lMap);
|
|
139
|
+
|
|
140
|
+
},
|
|
141
|
+
drawSuccess(obj) {
|
|
142
|
+
this.polygonModel = {
|
|
143
|
+
fillColor: '#000',
|
|
144
|
+
stroke: '#fff',
|
|
145
|
+
width: 4,
|
|
146
|
+
text: '',
|
|
147
|
+
geo: obj.geoJson,
|
|
148
|
+
id: 'ceshi',
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
drawError(obj) {},
|
|
152
|
+
mapClick(e) {
|
|
153
|
+
// alert(e);
|
|
154
|
+
},
|
|
155
|
+
onLoad(e) {},
|
|
156
|
+
crossHairClick(e) {
|
|
157
|
+
// console.log(e);
|
|
158
|
+
},
|
|
159
|
+
mapMoveend(e) {
|
|
160
|
+
// alert(1);
|
|
161
|
+
// console.log(e);
|
|
162
|
+
},
|
|
163
|
+
loadDrawPolygonEvent(e) {
|
|
164
|
+
this.mapTool = e;
|
|
165
|
+
},
|
|
166
|
+
clusterCallback({
|
|
167
|
+
id,
|
|
168
|
+
isShow
|
|
169
|
+
}) {
|
|
170
|
+
setTimeout(r => {
|
|
171
|
+
this.showPolygon = {
|
|
172
|
+
id,
|
|
173
|
+
isShow
|
|
174
|
+
};
|
|
175
|
+
this.isCheckPoint = {
|
|
176
|
+
id,
|
|
177
|
+
isShow
|
|
178
|
+
};
|
|
179
|
+
}, 50);
|
|
180
|
+
},
|
|
181
|
+
changeSwitchMap(obj) {
|
|
182
|
+
if (obj.mapType == 2) {
|
|
183
|
+
this.gpsType = 0;
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
this.gpsType = obj.mapType;
|
|
187
|
+
},
|
|
188
|
+
onClick() {
|
|
189
|
+
this.isRyMapTool = !this.isRyMapTool;
|
|
190
|
+
},
|
|
191
|
+
onClick2() {
|
|
192
|
+
this.maxZoom = 28;
|
|
193
|
+
},
|
|
194
|
+
onClick3() {
|
|
195
|
+
this.maxZoom = 10;
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
</script>
|
|
201
|
+
|
|
202
|
+
<style lang="scss" scoped>
|
|
203
|
+
.map-style {
|
|
204
|
+
height: 100vh;
|
|
205
|
+
position: relative;
|
|
206
|
+
}
|
|
207
|
+
</style>
|