ry-vue-map 0.3.4 → 0.3.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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ry-vue-map",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
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.4.3",
48
+ "ry-map": "^0.4.6",
49
49
  "vue": "~2.6.14",
50
50
  "vue-demi": "^0.13.11",
51
51
  "vue-router": "~3.5.2",
@@ -60,6 +60,7 @@
60
60
  }
61
61
  },
62
62
  isShowAll(val) {
63
+
63
64
  if (val) {
64
65
  this.showAll();
65
66
  return;
@@ -21,25 +21,20 @@
21
21
  <slot name="polygon" :mapDto="{map,lMap}">
22
22
 
23
23
  </slot>
24
-
24
+
25
25
  <slot name="marker" :mapDto="{map,lMap}">
26
-
26
+
27
27
  </slot>
28
28
  </template>
29
-
30
- <SwitchMap
31
- v-if="isSwitchMapTool && isShowSwitchMap"
32
- :height="switchMapHeight"
33
- :switchMapDefaultTypeOrLayer="switchMapDefaultTypeOrLayer"
34
- :mapTypeAndLayer="mapTypeAndLayer"
35
- class="move-box" :style="{
29
+
30
+ <SwitchMap v-if="isSwitchMapTool && isShowSwitchMap" :height="switchMapHeight"
31
+ :switchMapDefaultTypeOrLayer="switchMapDefaultTypeOrLayer" :mapTypeAndLayer="mapTypeAndLayer"
32
+ class="move-box" :style="{
36
33
  top:switchMapPosTop + 'px',
37
34
  right:isSwitchMapRight?switchMapPosLeftOrRight + 'px':'none',
38
35
  left:!isSwitchMapRight?switchMapPosLeftOrRight + 'px':'none'
39
- }" :bottom-right="isSwitchMapRight"
40
- @changeSwitchMap="changeSwitchMap"
41
- :isDisabled= "isDisabledSwitchMapTabEvent"
42
- />
36
+ }" :bottom-right="isSwitchMapRight" @changeSwitchMap="changeSwitchMap"
37
+ :isDisabled="isDisabledSwitchMapTabEvent" />
43
38
 
44
39
  <!-- 'current': !isRyMapTool || !isRight -->
45
40
  </div>
@@ -123,15 +118,15 @@
123
118
  mapType,
124
119
  layerType
125
120
  }) {
126
-
121
+
127
122
  this.lMap.selectMapLayer(mapType, layerType);
128
123
  this._setMaxZoom(mapType, layerType);
129
- let _mapType = mapType;
130
- if (mapType > 1) {
131
- _mapType = 0;
132
- }
133
- if (this.lastMapType == _mapType ) return;
134
-
124
+ let _mapType = mapType;
125
+ if (mapType > 1) {
126
+ _mapType = 0;
127
+ }
128
+ if (this.lastMapType == _mapType) return;
129
+
135
130
  this.lastMapType = _mapType;
136
131
 
137
132
  const center = this.lMap.getCenter();
@@ -153,7 +148,7 @@
153
148
  this.$emit('changeSwitchMap', {
154
149
  mapType: _mapType,
155
150
  layerType,
156
- type:mapType
151
+ type: mapType
157
152
  });
158
153
  },
159
154
  _setMaxZoom(type, layerType) {
@@ -171,8 +166,8 @@
171
166
  type: this.mapType,
172
167
  layerType: this.layerType,
173
168
  viewOptions: this.getViewOptions(),
174
-
175
- callback: (map,layers) => {
169
+
170
+ callback: (map, layers) => {
176
171
  this.map = map;
177
172
 
178
173
  if (this.bbox.length > 0) {
@@ -254,15 +249,15 @@
254
249
  if (evt.dragging) {
255
250
  return;
256
251
  }
257
-
252
+
258
253
  const pixel = this.map.getEventPixel(evt.originalEvent);
259
254
  const hit = this.map.hasFeatureAtPixel(pixel);
260
255
  if (hit) {
261
256
  const _feature = this.map.forEachFeatureAtPixel(evt.pixel, feature => feature);
262
- this.$emit('mapClick2', _feature);
257
+ this.$emit('mapClick2', _feature);
263
258
  const _id = _feature.getId();
264
259
  if (_id === undefined) {
265
- // this.$emit('mapClick2', _feature);
260
+ // this.$emit('mapClick2', _feature);
266
261
  return;
267
262
  }
268
263
  this.$emit('mapClick', _id);
@@ -346,4 +341,4 @@
346
341
  .move-box {
347
342
  position: absolute;
348
343
  }
349
- </style>
344
+ </style>
@@ -25,24 +25,7 @@
25
25
 
26
26
  </slot>
27
27
  </template>
28
- <!--
29
- <SwitchMap
30
- v-if="isSwitchMapTool && isShowSwitchMap"
31
- :height="switchMapHeight"
32
- :switchMapDefaultTypeOrLayer="switchMapDefaultTypeOrLayer"
33
- :mapTypeAndLayer="mapTypeAndLayer"
34
- class="move-box" :style="{
35
- top:switchMapPosTop + 'px',
36
- right:isSwitchMapRight?switchMapPosLeftOrRight + 'px':'none',
37
- left:!isSwitchMapRight?switchMapPosLeftOrRight + 'px':'none'
38
- }" :bottom-right="isSwitchMapRight"
39
- @changeSwitchMap="changeSwitchMap"
40
- :isDisabled= "isDisabledSwitchMapTabEvent"
41
- /> -->
42
28
  </div>
43
-
44
-
45
-
46
29
  </template>
47
30
  <script>
48
31
  import MapServices from '@/utils/lMapServices.js';
@@ -50,7 +33,6 @@
50
33
  import ViewDto from './../../models/ryMap/view.js';
51
34
  import MapToolDto from './../../models/ryMapTool/mapTool.js';
52
35
  import RyMapTool from '../../ryMapTool/src/index';
53
- // import SwitchMap from '../../switchMap/src/newIndex';
54
36
  import {
55
37
  ViewOptions,
56
38
  fitNew,
@@ -121,43 +103,6 @@
121
103
  },
122
104
 
123
105
  methods: {
124
- changeSwitchMap({
125
- mapType,
126
- layerType
127
- }) {
128
-
129
- this.lMap.selectMapLayer(mapType, layerType);
130
- this._setMaxZoom(mapType, layerType);
131
- let _mapType = mapType;
132
- if (mapType > 1) {
133
- _mapType = 0;
134
- }
135
- if (this.lastMapType == _mapType) return;
136
-
137
- this.lastMapType = _mapType;
138
-
139
- const center = this.lMap.getCenter();
140
- if (center && center.length) {
141
- if (_mapType == 0) {
142
- const {
143
- lon,
144
- lat
145
- } = GPS.gcj_decrypt(center[0], center[1]);
146
- this.lMap.setCenter([lon, lat]);
147
- } else {
148
- const {
149
- lon,
150
- lat
151
- } = GPS.gcj_encrypt(center[0], center[1]);
152
- this.lMap.setCenter([lon, lat]);
153
- }
154
- }
155
- this.$emit('changeSwitchMap', {
156
- mapType: _mapType,
157
- layerType,
158
- type: mapType
159
- });
160
- },
161
106
  _setMaxZoom(type, layerType) {
162
107
  if (type == 2 || layerType == 0) {
163
108
  this.setMaxZoom(18);
@@ -178,8 +123,8 @@
178
123
  lMap.getView().fit(this.bbox, [
179
124
  50, 50, 50, 50
180
125
  ]);
181
- const {geo,width,color} = this.boundaryModel;
182
- lMap.initMapMaskEvent(map.getLayers(), geo,width,color);
126
+ const {geo,width,color,lineDash} = this.boundaryModel;
127
+ lMap.initMapMaskEvent(map.getLayers(), geo,{width,color,lineDash});
183
128
  }
184
129
  });
185
130
  },