ry-vue-map 0.2.3 → 0.2.5

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.
@@ -0,0 +1,205 @@
1
+ <template>
2
+ <div class="map-style">
3
+
4
+ <ry-map projection="EPSG:4326" :zoom="10" :minZoom="1" :maxZoom="maxZoom" :center="center" @load="load($event)"
5
+ :isCrossHair="isRyMapTool" :isRight="true" :isRyMapTool="true" @drawSuccess="drawSuccess"
6
+ @drawError="drawError" :isShowRangingTool="true" :isShowDrawTool="isRyMapTool" :bindMapClick="true"
7
+ @mapClick="mapClick($event)" @crossHairClick="crossHairClick($event)" :bindMapMoveend="true"
8
+ @mapMoveend="mapMoveend($event)"
9
+ v-if="dto"
10
+ :boundaryModel="dto"
11
+ :urls="urls"
12
+ :bbox="bbox"
13
+ >
14
+ </ry-map>
15
+
16
+ <button @click="onClick()">测试</button>
17
+ <button @click="onClick2()">测试2</button>
18
+ <button @click="onClick3()">测试3</button>
19
+
20
+ <aside class="aside-style">
21
+ <el-button
22
+ class="ele-text-primary" v-show="isShowPaly" style="padding:10px;" @click.stop="onShowPaly(false)">
23
+ 轨迹回放 </el-button>
24
+
25
+ <el-button
26
+ class="ele-text-primary" v-show="!isShowPaly" style="padding:10px; color: red;" @click.stop="onShowPaly(true)">
27
+ 结束轨迹回放 </el-button>
28
+ </aside>
29
+ </div>
30
+ </template>
31
+
32
+ <script>
33
+ import dayjs from 'dayjs'
34
+ import RyMap from '@/components/maps/ryOfflineMap/src/index.vue';
35
+ import RyMapTool from '@/components/maps/ryMapTool/src/index.vue';
36
+ import RyPolygon from '@/components/maps/ryPolygon/src/index.vue';
37
+ import RyPolygons from '@/components/maps/ryPolygons/src/index.vue';
38
+ import RyClustersMarker from '@/components/maps/ryClustersMarker/src/index.vue';
39
+ import RyPolygonGeo from '@/components/maps/ryPolygonGeo/src/index.vue';
40
+ import geoJson from "./330112";
41
+
42
+
43
+
44
+ export default {
45
+ components: {
46
+ RyMap,
47
+ RyMapTool,
48
+ RyPolygon,
49
+ RyPolygons,
50
+ RyClustersMarker,
51
+ RyPolygonGeo,
52
+ },
53
+ data() {
54
+ return {
55
+ map: null,
56
+ lMap: null,
57
+ polygonColorObj: null,
58
+ // const bbox = [ 118.84072600000002, 29.937127000000032, 119.86315600000012, 30.445895000000064 ];
59
+ // const center = [119.34667114000006, 30.198078622500038];
60
+
61
+
62
+ bbox: [118.84072600000002, 29.937127000000032, 119.86315600000012, 30.445895000000064],
63
+ isClear: false,
64
+ colors: [],
65
+ modelArr2: [
66
+ {id:'ceshi1', x:120.15535003220648,y:30.179378795342608},
67
+ {id:'ceshi2',x:120.16369976775891,y:30.1967116895034},
68
+ {id:'ceshi3',x:120.156817,y:30.1753985} ,
69
+ {id:'ceshi4',x:120.1538245,y:30.183076} ,
70
+ ],
71
+ center: [119.34667114000006, 30.198078622500038],
72
+ polygonColors: [],
73
+ remove: 'ceshi1',
74
+ removes: [],
75
+ ranges: [],
76
+ restFit: true,
77
+ range: 'ceshi2',
78
+ isFit: false,
79
+ insert: null,
80
+ showPolygon: null,
81
+ showPolygons: [{
82
+ id: 'ceshi2',
83
+ isShow: false
84
+ }],
85
+ inserts: [],
86
+ isShowAll: false,
87
+ polygonModel: null,
88
+ mapTool: null,
89
+ isCheckPoint: null,
90
+ gpsType: 0,
91
+ isRyMapTool: true,
92
+ maxZoom: 18,
93
+ lineData1:null,
94
+ lineData2:null,
95
+ clearLiens:false,
96
+ // startMarkerDto:null,
97
+ // endMarkerDto:null,
98
+ startMarkerDto: {
99
+ url:require('@/assets/startpoint.png'),
100
+ height:23,
101
+ offset:[8, -11],
102
+ width:28
103
+ },
104
+ endMarkerDto:{
105
+ url:require('@/assets/stoppoint.png'),
106
+ height:16,
107
+ offset:[0, -8],
108
+ width:16
109
+ },
110
+ lineAppend:[],
111
+ isShowPaly:true,
112
+ layerArr:[2,2],
113
+ urls:[
114
+ `http://127.0.0.1:10006/${330112}/satellite/{z}/{x}/{y}.jpg`,
115
+ `http://127.0.0.1:10006/${330112}/overlay/{z}/{x}/{y}.png`
116
+ ],
117
+ dto:null,
118
+ };
119
+ },
120
+ created() {
121
+ this.dto={
122
+ geo:geoJson,
123
+ width:4,
124
+ color:'#000'
125
+ };
126
+ console.log(this.dto);
127
+ },
128
+ methods: {
129
+ onShowPaly(b) {
130
+ this.isShowPaly = b;
131
+
132
+ },
133
+ load(obj) {
134
+ this.lMap = obj.mapServices;
135
+ this.map = obj.map;
136
+ console.log(this.lMap);
137
+
138
+ },
139
+ drawSuccess(obj) {
140
+ this.polygonModel = {
141
+ fillColor: '#000',
142
+ stroke: '#fff',
143
+ width: 4,
144
+ text: '',
145
+ geo: obj.geoJson,
146
+ id: 'ceshi',
147
+ };
148
+ },
149
+ drawError(obj) {},
150
+ mapClick(e) {
151
+ // alert(e);
152
+ },
153
+ onLoad(e) {},
154
+ crossHairClick(e) {
155
+ // console.log(e);
156
+ },
157
+ mapMoveend(e) {
158
+ // alert(1);
159
+ // console.log(e);
160
+ },
161
+ loadDrawPolygonEvent(e) {
162
+ this.mapTool = e;
163
+ },
164
+ clusterCallback({
165
+ id,
166
+ isShow
167
+ }) {
168
+ setTimeout(r => {
169
+ this.showPolygon = {
170
+ id,
171
+ isShow
172
+ };
173
+ this.isCheckPoint = {
174
+ id,
175
+ isShow
176
+ };
177
+ }, 50);
178
+ },
179
+ changeSwitchMap(obj) {
180
+ if (obj.mapType == 2) {
181
+ this.gpsType = 0;
182
+ return;
183
+ }
184
+ this.gpsType = obj.mapType;
185
+ },
186
+ onClick() {
187
+ this.isRyMapTool = !this.isRyMapTool;
188
+ },
189
+ onClick2() {
190
+ this.maxZoom = 28;
191
+ },
192
+ onClick3() {
193
+ this.maxZoom = 10;
194
+ },
195
+
196
+ }
197
+ };
198
+ </script>
199
+
200
+ <style lang="scss" scoped>
201
+ .map-style {
202
+ height: 100vh;
203
+ position: relative;
204
+ }
205
+ </style>
@@ -64,7 +64,6 @@
64
64
  id: 'ceshi',
65
65
  };
66
66
  del();
67
- console.log(this.polygonModel);
68
67
  },
69
68
  drawError(obj) {
70
69
  console.log(obj);
@@ -68,7 +68,7 @@
68
68
  mapClick(e){
69
69
  console.log(e);
70
70
  },
71
- drawSuccess(obj) {
71
+ drawSuccess(obj) {
72
72
  this.polygonModel = {
73
73
  fillColor: '#000',
74
74
  stroke: '#fff',
@@ -77,7 +77,7 @@
77
77
  geo: obj.geoJson,
78
78
  id: 'ceshi',
79
79
  };
80
- console.log(this.polygonModel);
80
+
81
81
  },
82
82
  drawError(obj) {},
83
83