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.
@@ -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" @load="load($event)"
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
- @changeSwitchMap="changeSwitchMap($event)" :isShowSwitchMap="true"
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 RyClustersMarker from '@/components/maps/ryClustersMarker/src/index.vue';
33
+ import RyClustersMarker from '@/components/maps/ryClustersMarker/src/index.vue';
43
34
  import RyPolygonGeo from '@/components/maps/ryPolygonGeo/src/index.vue';
44
- import geo from './ceshijson';
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
- const polygonModel = {
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
- getCenter,
62
- getHeight,
63
- getWidth
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: [ 121.28732413948202,28.645057235065444],
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
- src:require("@/assets/1.png"),
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
- // :bbox="[121.28732413948202, 28.447719613141608, 121.6675012766673, 28.645057235065444]"
116
- // console.log(geo.features);
117
- // var arr=[];
118
- // for(let i=0;i<geo.features.length;i++){
119
- // let {geometry:{coordinates},properties}=geo.features[i];
120
- // // console.log(geo.features[i]);
121
- // // console.log(coordinates);
122
- // properties.bbox=getLngAndLatMaxMin(coordinates);
123
-
124
- // properties.center=getCenter(properties.bbox);
125
- // arr.push(properties);
126
- // // console.log(getLngAndLatMaxMin(coordinates));
127
- // }
128
- // console.log(arr);
129
- // setTimeout(r=> {
130
- // this.kmlModels=[
131
- // {
132
- // "bbox": [
133
- // 120.063902,
134
- // 30.860046,
135
- // 120.064164,
136
- // 30.860164
137
- // ],
138
- // "id": 1869,
139
- // "url": "https://rydemo.ryaims.com:9443/ryfiles/81/b8c2429815344596ada3767f1668c438.kml",
140
- // "gcj02Url": "https://rydemo.ryaims.com:9443/ryfiles/31/aed50d22cc6d4093b212184854f5b6ea.kml",
141
- // "width": "2",
142
- // "extractStyles": false,
143
- // "stroke": "rgb(6,108,211)",
144
- // "fillColor": "rgb(6,108,211)"
145
- // },
146
- // {
147
- // "bbox": [
148
- // 120.063138,
149
- // 30.858118,
150
- // 120.064633,
151
- // 30.859334
152
- // ],
153
- // "id": 1871,
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
- this.setColor={
166
- id:1869,
167
- color:'#000'
168
- }
169
- },5000);
150
+ // setTimeout(r => {
151
+ // this.setColor = {
152
+ // id: 1869,
153
+ // color: '#000'
154
+ // }
155
+ // }, 5000);
170
156
 
171
- setTimeout(r=> {
172
- this.setColor={
173
- id:1871,
174
- color:'#000'
175
- }
176
- },6000);
157
+ // setTimeout(r => {
158
+ // this.setColor = {
159
+ // id: 1871,
160
+ // color: '#000'
161
+ // }
162
+ // }, 6000);
177
163
 
178
164
 
179
- // setTimeout(r=> {
165
+ // setTimeout(r=> {
180
166
  // this.$$refs.rykmls.setFit();
181
167
  // },8000);
182
-
168
+
183
169
  },
184
170
  methods: {
185
171
  onShowPaly(b) {
186
- this.isShowPaly = b;
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
- // console.log(geo2.getSource().getExtent());
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
- console.log(e);
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('ZLDWMC'));
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>