ry-vue-map 0.3.3 → 0.3.4
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 +70 -46
- package/lib/ryui.common.js.gz +0 -0
- package/lib/ryui.css +1 -1
- package/lib/ryui.css.gz +0 -0
- package/lib/ryui.umd.js +70 -46
- package/lib/ryui.umd.js.gz +0 -0
- package/lib/ryui.umd.min.js +2 -2
- package/lib/ryui.umd.min.js.gz +0 -0
- package/package.json +1 -1
- package/src/components/maps/ryStaticMap/src/index.vue +71 -52
- package/src/views/map/imgUrl.js +434 -110
- package/src/views/map/index.vue +104 -144
package/src/views/map/index.vue
CHANGED
|
@@ -1,82 +1,88 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="map-style">
|
|
3
3
|
|
|
4
|
-
<ry-map projection="EPSG:4326" :
|
|
4
|
+
<!-- <ry-map projection="EPSG:4326" :zoom="10" :minZoom="1" :maxZoom="maxZoom" :center="center" @load="load($event)"
|
|
5
5
|
:isCrossHair="isRyMapTool" :isRight="true" :isRyMapTool="true" @drawSuccess="drawSuccess"
|
|
6
6
|
@drawError="drawError" :isShowRangingTool="true" :isShowDrawTool="isRyMapTool" :bindMapClick="true"
|
|
7
7
|
@mapClick="mapClick($event)" @crossHairClick="crossHairClick($event)" :bindMapMoveend="true"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
@mapMoveend="mapMoveend($event)" v-if="dto" :boundaryModel="dto" :urls="urls" :bbox="bbox">
|
|
9
|
+
</ry-map> -->
|
|
10
|
+
|
|
11
|
+
<RyStaticMap class="map-style" :url="url"
|
|
12
|
+
:minZoom="15" :maxZoom="18" :zoom="15.6" :center="center" @load="loadMap" @selectMapEvent="selectMapEvent">
|
|
13
|
+
</RyStaticMap>
|
|
14
|
+
|
|
15
|
+
<button @click="onClick()">测试</button>
|
|
16
|
+
<button @click="onClick2()">测试2</button>
|
|
17
|
+
<button @click="onClick3()">测试3</button>
|
|
18
|
+
|
|
19
|
+
<!-- <aside class="aside-style">
|
|
20
|
+
<el-button class="ele-text-primary" v-show="isShowPaly" style="padding:10px;"
|
|
21
|
+
@click.stop="onShowPaly(false)">
|
|
22
|
+
轨迹回放 </el-button>
|
|
23
|
+
|
|
24
|
+
<el-button class="ele-text-primary" v-show="!isShowPaly" style="padding:10px; color: red;"
|
|
25
|
+
@click.stop="onShowPaly(true)">
|
|
26
|
+
结束轨迹回放 </el-button>
|
|
27
|
+
</aside> -->
|
|
24
28
|
</div>
|
|
25
29
|
</template>
|
|
26
30
|
|
|
27
31
|
<script>
|
|
28
32
|
import dayjs from 'dayjs'
|
|
29
|
-
import
|
|
33
|
+
import RyStaticMap from '@/components/maps/ryStaticMap/src/index.vue';
|
|
30
34
|
import RyMapTool from '@/components/maps/ryMapTool/src/index.vue';
|
|
31
35
|
import RyPolygon from '@/components/maps/ryPolygon/src/index.vue';
|
|
32
36
|
import RyPolygons from '@/components/maps/ryPolygons/src/index.vue';
|
|
33
37
|
import RyClustersMarker from '@/components/maps/ryClustersMarker/src/index.vue';
|
|
34
38
|
import RyPolygonGeo from '@/components/maps/ryPolygonGeo/src/index.vue';
|
|
35
|
-
import
|
|
36
|
-
|
|
37
|
-
import urls from './imgUrl';
|
|
38
|
-
import RyStaticLayers from '@/components/maps/ryStaticLayers/src/index.vue';
|
|
39
|
-
import {
|
|
40
|
-
createPolygonBoundary,
|
|
41
|
-
GPS,
|
|
42
|
-
getLngAndLatMaxMin
|
|
43
|
-
} from "ry-map";
|
|
44
|
-
const polygonModel = {
|
|
45
|
-
fillColor: 'transparent',
|
|
46
|
-
stroke: '#F7B500',
|
|
47
|
-
strokeWidth: 3,
|
|
48
|
-
lineDash: [1, 2, 3, 4, 5, 6],
|
|
49
|
-
geo: geo,
|
|
50
|
-
id: 'ceshi5',
|
|
51
|
-
};
|
|
39
|
+
import geoJson from "./330112";
|
|
40
|
+
|
|
52
41
|
|
|
53
|
-
import {
|
|
54
|
-
getCenter,
|
|
55
|
-
getHeight,
|
|
56
|
-
getWidth
|
|
57
|
-
} from 'ol/extent';
|
|
58
42
|
|
|
59
43
|
export default {
|
|
60
44
|
components: {
|
|
61
|
-
|
|
45
|
+
RyStaticMap,
|
|
62
46
|
RyMapTool,
|
|
63
47
|
RyPolygon,
|
|
64
48
|
RyPolygons,
|
|
65
49
|
RyClustersMarker,
|
|
66
50
|
RyPolygonGeo,
|
|
67
|
-
RyKMLs,
|
|
68
|
-
RyStaticLayers
|
|
69
51
|
},
|
|
70
52
|
data() {
|
|
71
53
|
return {
|
|
72
54
|
map: null,
|
|
73
55
|
lMap: null,
|
|
74
56
|
polygonColorObj: null,
|
|
75
|
-
bbox
|
|
57
|
+
// const bbox = [ 118.84072600000002, 29.937127000000032, 119.86315600000012, 30.445895000000064 ];
|
|
58
|
+
// const center = [119.34667114000006, 30.198078622500038];
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
bbox: [118.84072600000002, 29.937127000000032, 119.86315600000012, 30.445895000000064],
|
|
76
62
|
isClear: false,
|
|
77
|
-
geoJson: null,
|
|
78
63
|
colors: [],
|
|
79
|
-
|
|
64
|
+
modelArr2: [{
|
|
65
|
+
id: 'ceshi1',
|
|
66
|
+
x: 120.15535003220648,
|
|
67
|
+
y: 30.179378795342608
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'ceshi2',
|
|
71
|
+
x: 120.16369976775891,
|
|
72
|
+
y: 30.1967116895034
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'ceshi3',
|
|
76
|
+
x: 120.156817,
|
|
77
|
+
y: 30.1753985
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'ceshi4',
|
|
81
|
+
x: 120.1538245,
|
|
82
|
+
y: 30.183076
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
center: [119.34667114000006, 30.198078622500038],
|
|
80
86
|
polygonColors: [],
|
|
81
87
|
remove: 'ceshi1',
|
|
82
88
|
removes: [],
|
|
@@ -92,110 +98,68 @@
|
|
|
92
98
|
}],
|
|
93
99
|
inserts: [],
|
|
94
100
|
isShowAll: false,
|
|
95
|
-
|
|
96
|
-
polygonModel: polygonModel,
|
|
101
|
+
polygonModel: null,
|
|
97
102
|
mapTool: null,
|
|
98
103
|
isCheckPoint: null,
|
|
99
|
-
gpsType:
|
|
104
|
+
gpsType: 0,
|
|
100
105
|
isRyMapTool: true,
|
|
101
106
|
maxZoom: 18,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
lineData1: null,
|
|
108
|
+
lineData2: null,
|
|
109
|
+
clearLiens: false,
|
|
110
|
+
// startMarkerDto:null,
|
|
111
|
+
// endMarkerDto:null,
|
|
112
|
+
startMarkerDto: {
|
|
113
|
+
url: require('@/assets/startpoint.png'),
|
|
114
|
+
height: 23,
|
|
115
|
+
offset: [8, -11],
|
|
116
|
+
width: 28
|
|
117
|
+
},
|
|
118
|
+
endMarkerDto: {
|
|
119
|
+
url: require('@/assets/stoppoint.png'),
|
|
120
|
+
height: 16,
|
|
121
|
+
offset: [0, -8],
|
|
122
|
+
width: 16
|
|
123
|
+
},
|
|
124
|
+
lineAppend: [],
|
|
125
|
+
isShowPaly: true,
|
|
126
|
+
layerArr: [2, 2],
|
|
127
|
+
dto: null,
|
|
128
|
+
url: 'http://localhost:8601/uploads/5d53650724f04dd3b2d90a7adaddc87e.png',
|
|
107
129
|
};
|
|
108
130
|
},
|
|
109
131
|
created() {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// this.kmlModels = [{
|
|
117
|
-
// "bbox": [
|
|
118
|
-
// 120.063902,
|
|
119
|
-
// 30.860046,
|
|
120
|
-
// 120.064164,
|
|
121
|
-
// 30.860164,
|
|
122
|
-
// "id": 1869,
|
|
123
|
-
// "url":
|
|
124
|
-
// "https://rydemo.ryaims.com:9443/ryfiles/81/b8c2429815344596ada3767f1668c438.kml",
|
|
125
|
-
// "gcj02Url":
|
|
126
|
-
// "https://rydemo.ryaims.com:9443/ryfiles/31/aed50d22cc6d4093b212184854f5b6ea.kml",
|
|
127
|
-
// "width": "2",
|
|
128
|
-
// "extractStyles": false,
|
|
129
|
-
// "stroke": "rgb(6,108,211)",
|
|
130
|
-
// "fillColor": "rgb(6,108,211)"
|
|
131
|
-
// },
|
|
132
|
-
// {
|
|
133
|
-
// "bbox": [
|
|
134
|
-
// 120.063138,
|
|
135
|
-
// 30.858118,
|
|
136
|
-
// 120.064633,
|
|
137
|
-
// 30.859334
|
|
138
|
-
// ],
|
|
139
|
-
// "id": 1871,
|
|
140
|
-
// "url": "https://rydemo.ryaims.com:9443/ryfiles/33/66f97d83f0e546b09c711abb4e1173e1.kml",
|
|
141
|
-
// "gcj02Url": "https://rydemo.ryaims.com:9443/ryfiles/40/9eb63a47aba545f098139856bcbfd0a4.kml",
|
|
142
|
-
// "width": "2",
|
|
143
|
-
// "extractStyles": false,
|
|
144
|
-
// "stroke": "rgb(12,217,166)",
|
|
145
|
-
// "fillColor": "rgb(12,217,166)"
|
|
146
|
-
// }
|
|
147
|
-
// ];
|
|
148
|
-
// }, 3000);
|
|
149
|
-
|
|
150
|
-
// setTimeout(r => {
|
|
151
|
-
// this.setColor = {
|
|
152
|
-
// id: 1869,
|
|
153
|
-
// color: '#000'
|
|
154
|
-
// }
|
|
155
|
-
// }, 5000);
|
|
156
|
-
|
|
157
|
-
// setTimeout(r => {
|
|
158
|
-
// this.setColor = {
|
|
159
|
-
// id: 1871,
|
|
160
|
-
// color: '#000'
|
|
161
|
-
// }
|
|
162
|
-
// }, 6000);
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
// setTimeout(r=> {
|
|
166
|
-
// this.$$refs.rykmls.setFit();
|
|
167
|
-
// },8000);
|
|
168
|
-
|
|
132
|
+
this.dto = {
|
|
133
|
+
geo: geoJson,
|
|
134
|
+
width: 4,
|
|
135
|
+
color: '#000'
|
|
136
|
+
};
|
|
137
|
+
console.log(this.dto);
|
|
169
138
|
},
|
|
170
139
|
methods: {
|
|
140
|
+
async loadMap({
|
|
141
|
+
map,
|
|
142
|
+
mapServices
|
|
143
|
+
}) {
|
|
144
|
+
this.map = map;
|
|
145
|
+
this.lMap = mapServices;
|
|
146
|
+
},
|
|
171
147
|
onShowPaly(b) {
|
|
172
148
|
this.isShowPaly = b;
|
|
173
|
-
},
|
|
174
|
-
load(obj) {
|
|
175
|
-
this.lMap = obj.mapServices;
|
|
176
|
-
this.map = obj.map;
|
|
177
|
-
// const geo2 = createPolygonBoundary(geo);
|
|
178
|
-
// this.map.addLayer(geo2 );
|
|
179
149
|
|
|
180
|
-
// console.log(geo2.getSource().getExtent());
|
|
181
|
-
},
|
|
182
|
-
getExtent() {
|
|
183
|
-
const geometry = this.getGeometry();
|
|
184
|
-
return geometry.getExtent();
|
|
185
150
|
},
|
|
186
151
|
drawSuccess(obj) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
152
|
+
this.polygonModel = {
|
|
153
|
+
fillColor: '#000',
|
|
154
|
+
stroke: '#fff',
|
|
155
|
+
width: 4,
|
|
156
|
+
text: '',
|
|
157
|
+
geo: obj.geoJson,
|
|
158
|
+
id: 'ceshi',
|
|
159
|
+
};
|
|
195
160
|
},
|
|
196
161
|
drawError(obj) {},
|
|
197
162
|
mapClick(e) {
|
|
198
|
-
console.log(e);
|
|
199
163
|
// alert(e);
|
|
200
164
|
},
|
|
201
165
|
onLoad(e) {},
|
|
@@ -203,9 +167,8 @@
|
|
|
203
167
|
// console.log(e);
|
|
204
168
|
},
|
|
205
169
|
mapMoveend(e) {
|
|
206
|
-
|
|
207
170
|
// alert(1);
|
|
208
|
-
console.log(e);
|
|
171
|
+
// console.log(e);
|
|
209
172
|
},
|
|
210
173
|
loadDrawPolygonEvent(e) {
|
|
211
174
|
this.mapTool = e;
|
|
@@ -233,21 +196,19 @@
|
|
|
233
196
|
this.gpsType = obj.mapType;
|
|
234
197
|
},
|
|
235
198
|
onClick() {
|
|
236
|
-
this.
|
|
199
|
+
this.url="http://localhost:8601/uploads/5d53650724f04dd3b2d90a7adaddc87e.png";
|
|
200
|
+
// this.isRyMapTool = !this.isRyMapTool;
|
|
237
201
|
},
|
|
238
202
|
onClick2() {
|
|
239
|
-
|
|
203
|
+
this.url="http://localhost:8601/uploads/23070b484f53466b9dd07c6757da9204.png";
|
|
204
|
+
// this.maxZoom = 28;
|
|
240
205
|
},
|
|
241
206
|
onClick3() {
|
|
242
207
|
this.maxZoom = 10;
|
|
243
208
|
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
// feature.get('ZLDWMC');
|
|
248
|
-
console.log(feature.get('name'));
|
|
209
|
+
selectMapEvent(){
|
|
210
|
+
|
|
249
211
|
}
|
|
250
|
-
|
|
251
212
|
}
|
|
252
213
|
};
|
|
253
214
|
</script>
|
|
@@ -256,6 +217,5 @@
|
|
|
256
217
|
.map-style {
|
|
257
218
|
height: 100vh;
|
|
258
219
|
position: relative;
|
|
259
|
-
|
|
260
220
|
}
|
|
261
221
|
</style>
|