ry-vue-map 0.6.13 → 0.6.15

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.
Files changed (55) hide show
  1. package/README.MD +1 -1
  2. package/lib/ryui.common.js +55467 -88168
  3. package/lib/ryui.common.js.gz +0 -0
  4. package/lib/ryui.css +1 -1
  5. package/lib/ryui.css.gz +0 -0
  6. package/lib/ryui.umd.js +55467 -88168
  7. package/lib/ryui.umd.js.gz +0 -0
  8. package/lib/ryui.umd.min.js +6 -13
  9. package/lib/ryui.umd.min.js.gz +0 -0
  10. package/package.json +2 -2
  11. package/src/components/maps/models/ryMap/map.js +13 -1
  12. package/src/components/maps/models/ryPolygons/ryPolygons.js +5 -5
  13. package/src/components/maps/ryMap/src/index.vue +44 -4
  14. package/src/components/maps/ryPolygon/src/index.vue +11 -12
  15. package/src/components/maps/ryPolygons/src/index.vue +19 -24
  16. package/src/views/map/index.vue +29 -14
  17. package/lib/ryui.common.0.js +0 -6852
  18. package/lib/ryui.common.0.js.gz +0 -0
  19. package/lib/ryui.common.2.js +0 -1034
  20. package/lib/ryui.common.2.js.gz +0 -0
  21. package/lib/ryui.common.3.js +0 -268
  22. package/lib/ryui.common.4.js +0 -163
  23. package/lib/ryui.common.5.js +0 -144
  24. package/lib/ryui.common.6.js +0 -177
  25. package/lib/ryui.common.7.js +0 -2373
  26. package/lib/ryui.common.7.js.gz +0 -0
  27. package/lib/ryui.common.8.js +0 -47
  28. package/lib/ryui.common.8.js.gz +0 -0
  29. package/lib/ryui.common.9.js +0 -23
  30. package/lib/ryui.umd.0.js +0 -6852
  31. package/lib/ryui.umd.0.js.gz +0 -0
  32. package/lib/ryui.umd.2.js +0 -1034
  33. package/lib/ryui.umd.2.js.gz +0 -0
  34. package/lib/ryui.umd.3.js +0 -268
  35. package/lib/ryui.umd.4.js +0 -163
  36. package/lib/ryui.umd.5.js +0 -144
  37. package/lib/ryui.umd.6.js +0 -177
  38. package/lib/ryui.umd.7.js +0 -2373
  39. package/lib/ryui.umd.7.js.gz +0 -0
  40. package/lib/ryui.umd.8.js +0 -47
  41. package/lib/ryui.umd.8.js.gz +0 -0
  42. package/lib/ryui.umd.9.js +0 -23
  43. package/lib/ryui.umd.min.0.js +0 -3
  44. package/lib/ryui.umd.min.0.js.gz +0 -0
  45. package/lib/ryui.umd.min.2.js +0 -1
  46. package/lib/ryui.umd.min.2.js.gz +0 -0
  47. package/lib/ryui.umd.min.3.js +0 -1
  48. package/lib/ryui.umd.min.4.js +0 -1
  49. package/lib/ryui.umd.min.5.js +0 -1
  50. package/lib/ryui.umd.min.6.js +0 -1
  51. package/lib/ryui.umd.min.7.js +0 -2
  52. package/lib/ryui.umd.min.7.js.gz +0 -0
  53. package/lib/ryui.umd.min.8.js +0 -1
  54. package/lib/ryui.umd.min.8.js.gz +0 -0
  55. package/lib/ryui.umd.min.9.js +0 -1
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ry-vue-map",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "private": false,
5
5
  "main": "lib/ryui.umd.min.js",
6
6
  "description": "ry公共组件库",
@@ -45,7 +45,7 @@
45
45
  "kml-to-geojson": "^1.0.13",
46
46
  "nprogress": "~0.2.0",
47
47
  "ol": "^6.14.1",
48
- "ry-map": "^0.5.4",
48
+ "ry-map": "^0.5.6",
49
49
  "vue": "~2.6.14",
50
50
  "vue-demi": "^0.13.11",
51
51
  "vue-router": "~3.5.2",
@@ -135,6 +135,18 @@ export default class MapDto {
135
135
  isShowSwitchMap={
136
136
  type: Boolean,
137
137
  default: true,
138
- }
138
+ }
139
+
140
+ // 是否开启 放大时显示多边形中的文字
141
+ resolution={
142
+ type: Boolean,
143
+ default: false,
144
+ }
145
+
146
+ // 设定值zoom 用于判断当前zoom是否大于 15 默认值15
147
+ zoomedIn = {
148
+ type: Number,
149
+ default:17,
150
+ };
139
151
 
140
152
  }
@@ -118,11 +118,11 @@ export default class PolygonsDto extends Base {
118
118
  default: false,
119
119
  };
120
120
 
121
- // 调校参数
122
- correct={
123
- type:Number,
124
- default:0,
125
- }
121
+ // // 调校参数
122
+ // correct={
123
+ // type:Number,
124
+ // default:0,
125
+ // }
126
126
 
127
127
  // // 是否开启 放大时显示多边形中的文字
128
128
  // declutter={
@@ -94,6 +94,9 @@
94
94
  },
95
95
  bindMapMoveend(val) {
96
96
  this._bingMapMoveend();
97
+ },
98
+ resolution(val){
99
+ this._bingResolution();
97
100
  },
98
101
  m(val) {
99
102
  this.m = val;
@@ -111,7 +114,8 @@
111
114
  lastMapType: 0,
112
115
  isFirstLoad: false,
113
116
  contextmenu: null,
114
- dblClick: null,
117
+ dblClick: null,
118
+ resolutionFun:null,
115
119
  };
116
120
  },
117
121
 
@@ -183,7 +187,8 @@
183
187
 
184
188
  }
185
189
  this._bingMapEvent();
186
- this._bingMapMoveend();
190
+ this._bingMapMoveend();
191
+ this._bingResolution();
187
192
  this._bindContextmenu();
188
193
  this._binddblClick();
189
194
  this.$emit('load', {
@@ -213,6 +218,15 @@
213
218
  } else {
214
219
  this._mapMoveend(true);
215
220
  }
221
+ },
222
+ _bingResolution(){
223
+ if(this.resolution){
224
+ this.bingResolutionEvent();
225
+ }
226
+ else {
227
+ this.bingResolutionEvent(true);
228
+ }
229
+
216
230
  },
217
231
  _bindContextmenu() {
218
232
  if (this.bindContextmenu) {
@@ -374,10 +388,36 @@
374
388
  } else {
375
389
  this.map.on('moveend', this.moveend);
376
390
  }
377
- },
391
+ },
392
+
378
393
  loadDrawPolygonEvent(e) {
379
394
  this.$emit('loadDrawPolygonEvent', e);
380
- }
395
+ },
396
+
397
+ bingResolutionEvent(isResolution = false){
398
+ const view =this.map.getView();
399
+ const zoomedIn = this.zoomedIn;
400
+ let isZoomedIn = view.getZoom() > zoomedIn;
401
+
402
+ this.resolutionFun= ()=> {
403
+ const currentZoom = view.getZoom();
404
+ if (currentZoom > zoomedIn && !isZoomedIn) {
405
+ isZoomedIn = true;
406
+ this.$emit('resolutionEvent', {zoom:currentZoom,status:isZoomedIn});
407
+ } else if (currentZoom <= zoomedIn && isZoomedIn) {
408
+ isZoomedIn = false;
409
+ this.$emit('resolutionEvent', {zoom:currentZoom,status:isZoomedIn});
410
+ }
411
+
412
+ };
413
+
414
+ if (isResolution) {
415
+ view.un('change:resolution', this.resolutionFun);
416
+ } else {
417
+ view.on('change:resolution', this.resolutionFun);
418
+ }
419
+
420
+ },
381
421
  }
382
422
  }
383
423
  </script>
@@ -73,10 +73,11 @@
73
73
  this.init();
74
74
  },
75
75
  methods: {
76
- initPolygonText(polygon,text,center){
77
- polygon.setShowText(true);
78
- polygon.setText(text);
79
- polygon.setCenter(center);
76
+ initPolygonText(polygon, obj) {
77
+ const {text, center, isShow} =obj;
78
+ polygon.setShowText(isShow);
79
+ polygon.setText(text);
80
+ polygon.setCenter(center);
80
81
  },
81
82
  init() {
82
83
  this.lastType=this.gpsType;
@@ -103,11 +104,11 @@
103
104
  this.setFit(this.gpsType==1 ? this.bboxGCJ02 : this.bbox);
104
105
  }
105
106
 
106
- if(!this.isCheckPointHide && this.model.text){
107
- if(centerArr && centerArr.length > 1){
108
- this.initPolygonText(this.polygon,this.model.text,centerArr);
109
- }
110
- }
107
+ if(!this.isCheckPointHide){
108
+ this.initPolygonText(this.polygon,{text:this.model.text,center:centerArr,isShow:true});
109
+ }else{
110
+ this.initPolygonText(this.polygon,{text:this.model.text,center:centerArr,isShow:false});
111
+ }
111
112
 
112
113
 
113
114
  // if (this.model.text) {
@@ -239,9 +240,7 @@
239
240
  // }
240
241
  },
241
242
  setText(text) {
242
- if (this.checkPoint) {
243
- this.checkPoint.setText(text);
244
- }
243
+ this.polygon.setText(text);
245
244
  },
246
245
  selectGPSAll(type){
247
246
  // if(this.checkPoint){
@@ -184,14 +184,19 @@
184
184
  this.polygonMap.set(val.id, polygon);
185
185
  const text = val.text;
186
186
  if (!this.isCheckPointHideAll && val.text) {
187
- if (center && center.length > 1) {
188
- this.initPolygonText(polygon, text, center);
189
- }
187
+ this.initPolygonText(polygon, {text, center,isShow:false});
188
+ }
189
+ else if(!this.isCheckPointHideAll && val.isShowText !==undefined && val.isShowText !==null && val.isShowText !== NaN){
190
+ this.initPolygonText(polygon, {text, center,isShow:val.isShowText});
191
+ }
192
+ else{
193
+ this.initPolygonText(polygon, {text, center,isShow:true});
190
194
  }
191
195
  }
192
196
  },
193
- initPolygonText(polygon, text, center) {
194
- polygon.setShowText(true);
197
+ initPolygonText(polygon, obj) {
198
+ const {text, center, isShow} =obj;
199
+ polygon.setShowText(isShow);
195
200
  polygon.setText(text);
196
201
  polygon.setCenter(center);
197
202
  },
@@ -366,26 +371,16 @@
366
371
  },
367
372
 
368
373
  _isCheckPointHide(val) {
369
-
370
374
  const id = val.id;
371
375
  if (this.polygonMap.has(id)) {
372
- const polygonMap = this.polygonMap.get(id);
373
- if (val.isShow) {
374
- polygonMap.setTextVisible(true);
375
- return;
376
- }
377
- polygonMap.setTextVisible(false);
376
+ const polygonMap = this.polygonMap.get(id).setTextVisible(val.isShow);
377
+ // if (val.isShow) {
378
+ // polygonMap.setTextVisible(true);
379
+ // return;
380
+ // }
381
+ // polygonMap.setTextVisible(false);
378
382
  }
379
383
 
380
- // const id = val.id;
381
- // if (this.checkPointMap.has(id)) {
382
- // const checkPoint = this.checkPointMap.get(id);
383
- // if (val.isShow) {
384
- // checkPoint.show();
385
- // return;
386
- // }
387
- // checkPoint.hide();
388
- // }
389
384
  },
390
385
 
391
386
  _isCheckPointHides(arr) {
@@ -395,9 +390,9 @@
395
390
  },
396
391
 
397
392
  setText(id, text) {
398
- if (this.checkPointMap.has(id)) {
399
- const checkPoint = this.checkPointMap.get(id);
400
- checkPoint.setText(text);
393
+ if (this.polygonMap.has(id)) {
394
+ const checkPoint = this.polygonMap.get(id);
395
+ checkPoint.setText(text);
401
396
  }
402
397
  },
403
398
  restBBOXArr() {
@@ -1,16 +1,16 @@
1
1
  <template>
2
2
  <div class="map-style">
3
3
  <ry-map projection="EPSG:4326" :zoom="15" :minZoom="1" :maxZoom="28" :center="center" @load="load($event)"
4
- :bindMapClick="true" @mapClick="mapClick($event)"  :switchMapDefaultTypeOrLayer="[0,2]">
4
+ :bindMapClick="true" @mapClick="mapClick($event)" :resolution="true" @resolutionEvent="resolutionEvent($event)"  :switchMapDefaultTypeOrLayer="[0,2]">
5
5
  <template #marker="{mapDto}">
6
6
  <!-- <ry-lines :isPlaybackTrackPoints="isPlaybackTrackPoints" :moveMarkerDto="moveMarkerDto" :map="mapDto.map"
7
7
  :isConneLine="false" :model="lineModel" :linenIsert="lineData" :isFit="true"></ry-lines> -->
8
8
  <!-- <RyWMSs v-if="wmsDtos.length" :map="mapDto.map" :modelArr="wmsDtos" /> -->
9
- <ry-polygons :isShowAll="isShowField" :isCheckPointHideAll="!isShowText" :map="mapDto.map" :isFit="true" :gpsType="0" :modelArr="modelArr" >
9
+ <ry-polygons :isShowAll="isShowField" :isCheckPointHide="testObj" :isCheckPointHideAll="!isShowText" :map="mapDto.map" :isFit="true" :gpsType="0" :modelArr="modelArr" >
10
10
  </ry-polygons>
11
11
 
12
- <ry-polygon :isShow="isShowField" :isCheckPointHide="!isShowText" :map="mapDto.map" :isFit="true" :gpsType="0" :model="modelArr[0]" >
13
- </ry-polygon>
12
+ <!-- <ry-polygon :isShow="isShowField" :isCheckPointHide="!isShowText" :map="mapDto.map" :isFit="true" :gpsType="0" :model="modelArr[0]" >
13
+ </ry-polygon> -->
14
14
  <!-- <RyKMLs @loadingEvent="loadingEvent($event)" :map="mapDto.map" :modelArr="kmls" ref="kmls"></RyKMLs> -->
15
15
  </template>
16
16
 
@@ -84,8 +84,8 @@
84
84
  zIndex: 20,
85
85
  type: 1,
86
86
  text:'10 亩',
87
- // isShowText: true,
88
- declutter: true,
87
+ //isShowText: false,
88
+ // declutter: false,
89
89
  };
90
90
 
91
91
  const polygonModel2 = {
@@ -98,7 +98,7 @@
98
98
  type: 1,
99
99
  text:'11 亩',
100
100
  //isShowText: true,
101
- declutter: true,
101
+ // declutter: true,
102
102
  };
103
103
 
104
104
  const polygonModel3 = {
@@ -111,7 +111,7 @@
111
111
  type: 1,
112
112
  text:'12 亩',
113
113
  //isShowText: true,
114
- declutter: true,
114
+ // declutter: true,
115
115
  };
116
116
 
117
117
  const polygonModel4 = {
@@ -124,7 +124,7 @@
124
124
  type: 1,
125
125
  text:'13 亩',
126
126
  //isShowText: true,
127
- declutter: true,
127
+ // declutter: true,
128
128
  };
129
129
 
130
130
 
@@ -151,7 +151,7 @@
151
151
  width: 16
152
152
  },
153
153
  isShowField:true,
154
- isShowText:true,
154
+ isShowText:false,
155
155
  map: null,
156
156
  lMap: null,
157
157
  polygonColorObj: null,
@@ -163,7 +163,11 @@
163
163
  center: [120.2687149, 29.8142052],
164
164
  lineModel: ModelLineArr[0],
165
165
  lineData: null,
166
- isPlaybackTrackPoints: false,
166
+ isPlaybackTrackPoints: false,
167
+ testObj:{
168
+ id:'ceshi1',
169
+ isShow:false,
170
+ },
167
171
  wmsDtos: [{
168
172
  url: 'https://geo.ryaims.com:8010/geoserver/daofeng/wms',
169
173
  id: 'daofeng',
@@ -252,8 +256,15 @@
252
256
  };
253
257
  },
254
258
  drawError(obj) {},
255
- mapClick(e) {
256
- // alert(e);
259
+ mapClick(e) {
260
+ console.log('e=====','e');
261
+ this.testObj={
262
+ id:'ceshi1',
263
+ // isShow:false,
264
+ isShow:!this.testObj.isShow,
265
+ };
266
+ // alert(e);
267
+
257
268
  // alert(e);
258
269
  },
259
270
  onLoad(e) {},
@@ -339,7 +350,11 @@
339
350
  },
340
351
  loadingEvent(e) {
341
352
  // alert(e);
342
- }
353
+ },
354
+ resolutionEvent(obj){
355
+ console.log('obj=======',obj);
356
+ this.isShowText=obj.status;
357
+ },
343
358
 
344
359
  }
345
360
  };