ry-vue-map 0.3.1 → 0.3.3
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 +50 -49
- package/lib/ryui.common.js.gz +0 -0
- package/lib/ryui.umd.js +50 -49
- package/lib/ryui.umd.js.gz +0 -0
- package/lib/ryui.umd.min.js +3 -3
- package/lib/ryui.umd.min.js.gz +0 -0
- package/package.json +4 -2
- package/src/components/maps/ryKMLs/src/index.vue +13 -11
- package/src/components/maps/ryStaticLayers/src/index.vue +3 -1
- package/src/views/map/imgUrl.js +1193 -0
- package/src/views/map/index.vue +94 -106
package/src/views/map/index.vue
CHANGED
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="map-style">
|
|
3
3
|
|
|
4
|
-
<ry-map projection="EPSG:4326" :center="center" :zoom="15" :minZoom="1" :maxZoom="maxZoom"
|
|
4
|
+
<ry-map projection="EPSG:4326" :center="center" :zoom="15" :minZoom="1" :maxZoom="maxZoom" @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
8
|
:isSwitchMapRight='true' :switchMapPosTop='60' :switchMapPosLeftOrRight="20" :switchMapHeight="40"
|
|
9
9
|
:switchMapDefaultTypeOrLayer="[1,2]" @mapMoveend="mapMoveend($event)"
|
|
10
|
-
@loadDrawPolygonEvent="loadDrawPolygonEvent($event)"
|
|
11
|
-
@
|
|
12
|
-
@mapClick2="mapClick2($event)"
|
|
13
|
-
>
|
|
10
|
+
@loadDrawPolygonEvent="loadDrawPolygonEvent($event)" @changeSwitchMap="changeSwitchMap($event)"
|
|
11
|
+
:isShowSwitchMap="true" @mapClick2="mapClick2($event)">
|
|
14
12
|
|
|
15
13
|
<template #marker="{mapDto}">
|
|
16
|
-
|
|
17
|
-
<ry-polygon-geo :isFit="true" :gpsType="gpsType" :map="mapDto.map" :model="polygonModel" :isStandardGeo="true" > </ry-polygon-geo>
|
|
18
|
-
<!-- <RyKMLs
|
|
19
|
-
v-if="kmlModels.length"
|
|
20
|
-
:map="mapDto.map"
|
|
21
|
-
:gpsType="gpsType"
|
|
22
|
-
:modelArr="kmlModels"
|
|
23
|
-
:isFit="true"
|
|
24
|
-
:setColor="setColor"
|
|
25
|
-
red="rykmls"
|
|
26
|
-
></RyKMLs> -->
|
|
27
|
-
|
|
28
14
|
|
|
15
|
+
<!-- <ry-polygon-geo :isFit="true" :gpsType="gpsType" :map="mapDto.map" :model="polygonModel" :isStandardGeo="true" > </ry-polygon-geo> -->
|
|
16
|
+
<!-- <RyKMLs v-if="kmlModels.length" :map="mapDto.map" :gpsType="gpsType" :modelArr="kmlModels" :isFit="true"
|
|
17
|
+
:setColor="setColor" red="rykmls"></RyKMLs> -->
|
|
18
|
+
|
|
19
|
+
<ry-static-layers :gpsType="gpsType" :map="mapDto.map" :modelArr="models" :isFit="true"></ry-static-layers>
|
|
29
20
|
</template>
|
|
30
21
|
|
|
31
22
|
</ry-map>
|
|
@@ -39,16 +30,18 @@
|
|
|
39
30
|
import RyMapTool from '@/components/maps/ryMapTool/src/index.vue';
|
|
40
31
|
import RyPolygon from '@/components/maps/ryPolygon/src/index.vue';
|
|
41
32
|
import RyPolygons from '@/components/maps/ryPolygons/src/index.vue';
|
|
42
|
-
import
|
|
33
|
+
import RyClustersMarker from '@/components/maps/ryClustersMarker/src/index.vue';
|
|
43
34
|
import RyPolygonGeo from '@/components/maps/ryPolygonGeo/src/index.vue';
|
|
44
|
-
|
|
35
|
+
import geo from './ceshijson';
|
|
45
36
|
import RyKMLs from '@/components/maps/ryKMLs/src/index.vue';
|
|
37
|
+
import urls from './imgUrl';
|
|
38
|
+
import RyStaticLayers from '@/components/maps/ryStaticLayers/src/index.vue';
|
|
46
39
|
import {
|
|
47
40
|
createPolygonBoundary,
|
|
48
41
|
GPS,
|
|
49
42
|
getLngAndLatMaxMin
|
|
50
43
|
} from "ry-map";
|
|
51
|
-
|
|
44
|
+
const polygonModel = {
|
|
52
45
|
fillColor: 'transparent',
|
|
53
46
|
stroke: '#F7B500',
|
|
54
47
|
strokeWidth: 3,
|
|
@@ -57,11 +50,11 @@
|
|
|
57
50
|
id: 'ceshi5',
|
|
58
51
|
};
|
|
59
52
|
|
|
60
|
-
import {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} from 'ol/extent';
|
|
53
|
+
import {
|
|
54
|
+
getCenter,
|
|
55
|
+
getHeight,
|
|
56
|
+
getWidth
|
|
57
|
+
} from 'ol/extent';
|
|
65
58
|
|
|
66
59
|
export default {
|
|
67
60
|
components: {
|
|
@@ -71,7 +64,8 @@ import {
|
|
|
71
64
|
RyPolygons,
|
|
72
65
|
RyClustersMarker,
|
|
73
66
|
RyPolygonGeo,
|
|
74
|
-
RyKMLs
|
|
67
|
+
RyKMLs,
|
|
68
|
+
RyStaticLayers
|
|
75
69
|
},
|
|
76
70
|
data() {
|
|
77
71
|
return {
|
|
@@ -82,7 +76,7 @@ import {
|
|
|
82
76
|
isClear: false,
|
|
83
77
|
geoJson: null,
|
|
84
78
|
colors: [],
|
|
85
|
-
center: [
|
|
79
|
+
center: [121.28732413948202, 28.645057235065444],
|
|
86
80
|
polygonColors: [],
|
|
87
81
|
remove: 'ceshi1',
|
|
88
82
|
removes: [],
|
|
@@ -105,98 +99,90 @@ import {
|
|
|
105
99
|
gpsType: 1,
|
|
106
100
|
isRyMapTool: true,
|
|
107
101
|
maxZoom: 18,
|
|
108
|
-
|
|
109
|
-
layerArr:[1,2],
|
|
110
|
-
kmlModels:[],
|
|
111
|
-
setColor:null,
|
|
102
|
+
src: require("@/assets/1.png"),
|
|
103
|
+
layerArr: [1, 2],
|
|
104
|
+
kmlModels: [],
|
|
105
|
+
setColor: null,
|
|
106
|
+
models:[],
|
|
112
107
|
};
|
|
113
108
|
},
|
|
114
109
|
created() {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
//
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
// "url": "https://rydemo.ryaims.com:9443/ryfiles/33/66f97d83f0e546b09c711abb4e1173e1.kml",
|
|
155
|
-
// "gcj02Url": "https://rydemo.ryaims.com:9443/ryfiles/40/9eb63a47aba545f098139856bcbfd0a4.kml",
|
|
156
|
-
// "width": "2",
|
|
157
|
-
// "extractStyles": false,
|
|
158
|
-
// "stroke": "rgb(12,217,166)",
|
|
159
|
-
// "fillColor": "rgb(12,217,166)"
|
|
160
|
-
// }
|
|
161
|
-
// ];
|
|
162
|
-
// },3000);
|
|
110
|
+
console.log(urls);
|
|
111
|
+
setTimeout(r => {
|
|
112
|
+
this.models=[urls[0]];
|
|
113
|
+
this.bbox=this.models[1].bbox;
|
|
114
|
+
},3000);
|
|
115
|
+
// setTimeout(r => {
|
|
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);
|
|
163
149
|
|
|
164
|
-
setTimeout(r=> {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
},5000);
|
|
150
|
+
// setTimeout(r => {
|
|
151
|
+
// this.setColor = {
|
|
152
|
+
// id: 1869,
|
|
153
|
+
// color: '#000'
|
|
154
|
+
// }
|
|
155
|
+
// }, 5000);
|
|
170
156
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
},6000);
|
|
157
|
+
// setTimeout(r => {
|
|
158
|
+
// this.setColor = {
|
|
159
|
+
// id: 1871,
|
|
160
|
+
// color: '#000'
|
|
161
|
+
// }
|
|
162
|
+
// }, 6000);
|
|
177
163
|
|
|
178
164
|
|
|
179
|
-
|
|
165
|
+
// setTimeout(r=> {
|
|
180
166
|
// this.$$refs.rykmls.setFit();
|
|
181
167
|
// },8000);
|
|
182
|
-
|
|
168
|
+
|
|
183
169
|
},
|
|
184
170
|
methods: {
|
|
185
171
|
onShowPaly(b) {
|
|
186
|
-
|
|
172
|
+
this.isShowPaly = b;
|
|
187
173
|
},
|
|
188
174
|
load(obj) {
|
|
189
175
|
this.lMap = obj.mapServices;
|
|
190
176
|
this.map = obj.map;
|
|
191
177
|
// const geo2 = createPolygonBoundary(geo);
|
|
192
178
|
// this.map.addLayer(geo2 );
|
|
193
|
-
|
|
194
|
-
|
|
179
|
+
|
|
180
|
+
// console.log(geo2.getSource().getExtent());
|
|
181
|
+
},
|
|
182
|
+
getExtent() {
|
|
183
|
+
const geometry = this.getGeometry();
|
|
184
|
+
return geometry.getExtent();
|
|
195
185
|
},
|
|
196
|
-
getExtent(){
|
|
197
|
-
const geometry = this.getGeometry();
|
|
198
|
-
return geometry.getExtent();
|
|
199
|
-
},
|
|
200
186
|
drawSuccess(obj) {
|
|
201
187
|
// this.polygonModel = {
|
|
202
188
|
// fillColor: '#000',
|
|
@@ -217,9 +203,9 @@ import {
|
|
|
217
203
|
// console.log(e);
|
|
218
204
|
},
|
|
219
205
|
mapMoveend(e) {
|
|
220
|
-
|
|
206
|
+
|
|
221
207
|
// alert(1);
|
|
222
|
-
|
|
208
|
+
console.log(e);
|
|
223
209
|
},
|
|
224
210
|
loadDrawPolygonEvent(e) {
|
|
225
211
|
this.mapTool = e;
|
|
@@ -255,11 +241,13 @@ import {
|
|
|
255
241
|
onClick3() {
|
|
256
242
|
this.maxZoom = 10;
|
|
257
243
|
},
|
|
258
|
-
mapClick2(feature){
|
|
244
|
+
mapClick2(feature) {
|
|
245
|
+
alert(1);
|
|
246
|
+
|
|
259
247
|
// feature.get('ZLDWMC');
|
|
260
|
-
console.log(feature.get('
|
|
248
|
+
console.log(feature.get('name'));
|
|
261
249
|
}
|
|
262
|
-
|
|
250
|
+
|
|
263
251
|
}
|
|
264
252
|
};
|
|
265
253
|
</script>
|
|
@@ -270,4 +258,4 @@ import {
|
|
|
270
258
|
position: relative;
|
|
271
259
|
|
|
272
260
|
}
|
|
273
|
-
</style>
|
|
261
|
+
</style>
|