ry-vue-map 0.0.2 → 0.0.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 +42966 -43261
- package/lib/ryui.common.js.gz +0 -0
- package/lib/ryui.css +1 -1
- package/lib/ryui.umd.js +42966 -43261
- package/lib/ryui.umd.js.gz +0 -0
- package/lib/ryui.umd.min.js +6 -2
- package/lib/ryui.umd.min.js.gz +0 -0
- package/package.json +2 -2
- package/src/components/maps/models/ryMap/map.js +5 -0
- package/src/components/maps/ryCrossHair/src/index.vue +66 -35
- package/src/components/maps/ryMap/src/index.vue +7 -3
- package/src/components/maps/ryMapTool/src/index.vue +2 -3
- package/src/components/maps/ryPolygon/src/index.vue +1 -1
- package/src/components/maps/switchMap/src/newIndex.vue +3 -0
- package/src/utils/lMapServices.js +6 -0
- package/src/views/map/3301.js +96828 -0
- package/src/views/map/331123.js +4736 -0
- package/src/views/map/index.vue +36 -16
package/lib/ryui.umd.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ry-vue-map",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "lib/ryui.umd.min.js",
|
|
6
6
|
"description": "ry公共组件库",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"element-ui": "~2.15.6",
|
|
39
39
|
"nprogress": "~0.2.0",
|
|
40
40
|
"ol": "^6.14.1",
|
|
41
|
-
"ry-map": "^0.2.
|
|
41
|
+
"ry-map": "^0.2.5",
|
|
42
42
|
"vue": "~2.6.14",
|
|
43
43
|
"vue-router": "~3.5.2",
|
|
44
44
|
"vue-server-renderer": "^2.6.14",
|
|
@@ -3,42 +3,73 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
name: 'RyCrossHair',
|
|
13
|
-
props: {
|
|
14
|
-
map: {
|
|
15
|
-
type: Object,
|
|
16
|
-
default: () => null,
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
created() {
|
|
20
|
-
this.map.addControl(new CrossHair(() => {
|
|
21
|
-
this.$emit('click', this.getCenter());
|
|
22
|
-
}));
|
|
23
|
-
},
|
|
24
|
-
data() {
|
|
25
|
-
return {
|
|
6
|
+
import {
|
|
7
|
+
watch
|
|
8
|
+
} from 'fs';
|
|
9
|
+
import {
|
|
10
|
+
CrossHair
|
|
11
|
+
} from 'ry-map';
|
|
26
12
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
export default {
|
|
14
|
+
name: 'RyCrossHair',
|
|
15
|
+
props: {
|
|
16
|
+
map: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default: () => null,
|
|
19
|
+
},
|
|
20
|
+
isHide: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false,
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
created() {
|
|
26
|
+
if (this.isHide && !this.crossHair) {
|
|
27
|
+
this.createCrossHair();
|
|
28
|
+
}
|
|
29
|
+
// this.map.addControl(new CrossHair(() => {
|
|
30
|
+
// this.$emit('click', this.getCenter());
|
|
31
|
+
// }));
|
|
32
|
+
},
|
|
33
|
+
watch: {
|
|
34
|
+
isHide(val) {
|
|
35
|
+
if (val && !this.crossHair) {
|
|
36
|
+
this.createCrossHair();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.removeControl();
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
data() {
|
|
43
|
+
return {
|
|
44
|
+
crossHair: null
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
// 点击获取地图把心中心点坐标
|
|
49
|
+
getCenter() {
|
|
50
|
+
if (!this.map) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const view = this.map.getView();
|
|
54
|
+
let [x, y] = view.getCenter();
|
|
55
|
+
return [x, y];
|
|
56
|
+
},
|
|
57
|
+
createCrossHair() {
|
|
58
|
+
this.crossHair = new CrossHair(() => {
|
|
59
|
+
this.$emit('click', this.getCenter());
|
|
60
|
+
});
|
|
61
|
+
this.map.addControl(this.crossHair);
|
|
62
|
+
},
|
|
63
|
+
removeControl() {
|
|
64
|
+
if (!this.map || !this.crossHair) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.map.removeControl(this.crossHair);
|
|
68
|
+
this.crossHair = null;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
41
72
|
</script>
|
|
42
73
|
|
|
43
74
|
<style>
|
|
44
|
-
</style>
|
|
75
|
+
</style>
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
'right':isRight
|
|
8
8
|
}"
|
|
9
9
|
v-if="lMap.map && isRyMapTool"
|
|
10
|
-
|
|
11
10
|
@crossHairClick="crossHairClick($event)"
|
|
12
11
|
:lMap="lMap"
|
|
13
12
|
:isShowRangingTool="isShowRangingTool"
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
</template>
|
|
42
41
|
|
|
43
42
|
<SwitchMap
|
|
44
|
-
v-if="isSwitchMapTool"
|
|
43
|
+
v-if="isSwitchMapTool && isShowSwitchMap"
|
|
45
44
|
:height="switchMapHeight"
|
|
46
45
|
:switchMapDefaultTypeOrLayer="switchMapDefaultTypeOrLayer"
|
|
47
46
|
:mapTypeAndLayer = "mapTypeAndLayer"
|
|
@@ -125,7 +124,7 @@
|
|
|
125
124
|
changeSwitchMap({mapType,layerType}){
|
|
126
125
|
this.lMap.selectMapLayer(mapType,layerType);
|
|
127
126
|
if(this.lastMapType == mapType) return;
|
|
128
|
-
|
|
127
|
+
this.lastMapType= mapType > 1? 0 : mapType;
|
|
129
128
|
let _mapType= mapType;
|
|
130
129
|
if(mapType > 1){
|
|
131
130
|
_mapType=0;
|
|
@@ -144,6 +143,7 @@
|
|
|
144
143
|
this.$emit('changeSwitchMap',{mapType:_mapType,layerType});
|
|
145
144
|
},
|
|
146
145
|
loadMap(el) {
|
|
146
|
+
// const dto =
|
|
147
147
|
this.lMap.init({
|
|
148
148
|
el,
|
|
149
149
|
type: this.mapType,
|
|
@@ -169,6 +169,10 @@
|
|
|
169
169
|
mapServices: this.lMap,
|
|
170
170
|
ryMapTool: this.$refs.mapTool
|
|
171
171
|
});
|
|
172
|
+
|
|
173
|
+
if(!this.isShowSwitchMap){
|
|
174
|
+
this.lastMapType= this.mapType > 2 ? 0 : this.mapType;
|
|
175
|
+
}
|
|
172
176
|
}
|
|
173
177
|
});
|
|
174
178
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<slot></slot>
|
|
47
47
|
</aside>
|
|
48
48
|
</template>
|
|
49
|
-
<ry-cross-hair v-if="lMap
|
|
49
|
+
<ry-cross-hair v-if="lMap" :isHide="isCrossHair" :map="lMap.map" @click="onClick($event)"></ry-cross-hair>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
</template>
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
isShowDrawTool(val) {
|
|
84
84
|
this.isShowDrawTool = val;
|
|
85
|
+
this.isCrossHair = val;
|
|
85
86
|
},
|
|
86
87
|
isRight(val) {
|
|
87
88
|
this.isShowDrawTool = val;
|
|
@@ -243,7 +244,6 @@
|
|
|
243
244
|
}
|
|
244
245
|
this.x = pointArr[0];
|
|
245
246
|
this.y = pointArr[1];
|
|
246
|
-
|
|
247
247
|
let _pointArr= pointArr;
|
|
248
248
|
if(this.gpsType){
|
|
249
249
|
let {lon,lat} = GPS.gcj_decrypt(pointArr[0],pointArr[1]);
|
|
@@ -268,7 +268,6 @@
|
|
|
268
268
|
this.lMap.onCancel();
|
|
269
269
|
},
|
|
270
270
|
selectGPSAll(type){
|
|
271
|
-
// this.onDelete();
|
|
272
271
|
this.lMap.removeDrawArr();
|
|
273
272
|
if(this.drawPolygon){
|
|
274
273
|
this.drawPolygon.selectGPS(type,true);
|