ry-vue-map 0.6.2 → 0.6.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,280 +0,0 @@
1
- <template>
2
- <div class="map-style">
3
-
4
- <ry-map :maxZoom="18" @load="loadMap($event)" :isShowSwitchMap="false" :layerType="2" :mapType="0">
5
- <template #polygon="{ mapDto }">
6
- <!-- <RyStaticLayer :map="mapDto.map" :model="model2">
7
-
8
- </RyStaticLayer>
9
- <RyStaticLayer :map="mapDto.map" :model="model">
10
-
11
- </RyStaticLayer> -->
12
- </template>
13
- </ry-map>
14
-
15
- <!-- <RyOfflineMap
16
- class="ry-offline-map"
17
- :urls="urls"
18
- :center="[118.84146054770122, 29.935677496166022]"
19
- :minZoom="1"
20
- :maxZoom="18"
21
- @load="load"
22
- >
23
- </RyOfflineMap> -->
24
-
25
- <button @click="onClick()">测试</button>
26
- <button @click="onClick2()">测试2</button>
27
- <button @click="onClick3()">测试3</button>
28
-
29
- <!-- <aside class="aside-style">
30
- <el-button class="ele-text-primary" v-show="isShowPaly" style="padding:10px;"
31
- @click.stop="onShowPaly(false)">
32
- 轨迹回放 </el-button>
33
-
34
- <el-button class="ele-text-primary" v-show="!isShowPaly" style="padding:10px; color: red;"
35
- @click.stop="onShowPaly(true)">
36
- 结束轨迹回放 </el-button>
37
- </aside> -->
38
- </div>
39
- </template>
40
-
41
- <script>
42
- import dayjs from 'dayjs'
43
- import RyMap from '@/components/maps/ryMap/src/index.vue';
44
- import RyOfflineMap from '@/components/maps/ryOfflineMap/src/index.vue';
45
-
46
- import RyMapTool from '@/components/maps/ryMapTool/src/index.vue';
47
- import RyPolygon from '@/components/maps/ryPolygon/src/index.vue';
48
- import RyPolygons from '@/components/maps/ryPolygons/src/index.vue';
49
- import RyClustersMarker from '@/components/maps/ryClustersMarker/src/index.vue';
50
- import RyPolygonGeo from '@/components/maps/ryPolygonGeo/src/index.vue';
51
- import geoJson from "./330112";
52
- import LineObj from './obj'
53
- import RyLines from '@/components/maps/ryLines/src/index.vue';
54
- import RyKML from '@/components/maps/ryKML/src/index.vue';
55
- import RyStaticLayer from '@/components/maps/ryStaticLayer/src/index.vue';
56
- const bboxs=[
57
- [119.4832605106809,30.17522722800645,119.5162239935529,30.20240023288245],
58
- [119.4832605106809,30.17522722800645,119.5162239935529,30.20240023288245],
59
- [119.4832605106809,30.17522722800645,119.5162239935529,30.20240023288245],
60
- [119.4832605106809,30.17522722800645,119.5162239935529,30.20240023288245],
61
- [119.4830523878688,30.17494943404726,119.5172307870407,30.20294858200727],
62
- ];
63
- export default {
64
- components: {
65
- RyMap,
66
- RyMapTool,
67
- RyPolygon,
68
- RyPolygons,
69
- RyClustersMarker,
70
- RyPolygonGeo,
71
- RyLines,
72
- RyKML,
73
- RyStaticLayer,
74
- RyOfflineMap
75
- },
76
- data() {
77
- return {
78
- // bbox:[119.5172307870407,30.20294858200727,119.4830523878688,30.17494943404726],
79
- kmlDto:null,
80
- map: null,
81
- lMap: null,
82
- polygonColorObj: null,
83
- lineData: null,
84
- isShowPaly: false,
85
- // const bbox = [ 118.84072600000002, 29.937127000000032, 119.86315600000012, 30.445895000000064 ];
86
- // const center = [119.34667114000006, 30.198078622500038];
87
-
88
- // bbox: [118.84146054770122, 29.935677496166022, 119.86391954737257, 30.44823698639243],
89
- isClear: false,
90
- colors: [],
91
- modelArr2: [{
92
- id: 'ceshi1',
93
- x: 120.15535003220648,
94
- y: 30.179378795342608
95
- },
96
- {
97
- id: 'ceshi2',
98
- x: 120.16369976775891,
99
- y: 30.1967116895034
100
- },
101
- {
102
- id: 'ceshi3',
103
- x: 120.156817,
104
- y: 30.1753985
105
- },
106
- {
107
- id: 'ceshi4',
108
- x: 120.1538245,
109
- y: 30.183076
110
- },
111
- ],
112
- center: [119.45009201705076, 30.177110869281915],
113
- polygonColors: [],
114
- remove: 'ceshi1',
115
- removes: [],
116
- ranges: [],
117
- restFit: true,
118
- range: 'ceshi2',
119
- isFit: false,
120
- insert: null,
121
- showPolygon: null,
122
- showPolygons: [{
123
- id: 'ceshi2',
124
- isShow: false
125
- }],
126
- inserts: [],
127
- isShowAll: false,
128
- polygonModel: null,
129
- mapTool: null,
130
- isCheckPoint: null,
131
- gpsType: 1,
132
- isRyMapTool: true,
133
- maxZoom: 18,
134
- lineData1: null,
135
- lineData2: null,
136
- clearLiens: false,
137
- // startMarkerDto:null,
138
- // endMarkerDto:null,
139
- startMarkerDto: {
140
- url: require('@/assets/startpoint.png'),
141
- height: 23,
142
- offset: [8, -11],
143
- width: 28
144
- },
145
- endMarkerDto: {
146
- url: require('@/assets/stoppoint.png'),
147
- height: 16,
148
- offset: [0, -8],
149
- width: 16
150
- },
151
- lineAppend: [],
152
- isShowPaly: true,
153
- layerArr: [2, 2],
154
- // urls: [
155
- // `https://zjhzla.ryaims.com/overlay/330112/satellite/{z}/{x}/{y}.jpg`,
156
- // // `https://zjhzla.ryaims.com/overlay/330112/roadmap/{z}/{x}/{y}.png`,
157
- // // `http://127.0.0.1:10006/${330112}/overlay/{z}/{x}/{y}.png`
158
- // ],
159
- urls:[
160
- `http://127.0.0.1:10003/{z}/{x}/{y}.png`
161
- ],
162
- model:null,
163
- // model2:{
164
- // id:2,
165
- // url:require('@/assets/linan.png'),
166
- // // bbox:[119.5172307870407,30.20294858200727,119.4830523878688,30.17494943404726],
167
- // // bbox:[119.4830523878688,30.17494943404726,119.5172307870407,30.20294858200727],
168
- // // bbox:[119.4830523878688,30.20294858200727,119.5172307870407,30.17494943404726],
169
- // bbox:[119.485901,30.177281,119.514383,30.200616],
170
- // zIndex:9,
171
- // },
172
- dto: null,
173
- };
174
- },
175
- created() {
176
- this.dto = {
177
- geo: geoJson,
178
- width: 6,
179
- color: '#00adfd',
180
- lineDash: [1, 2, 3, 4, 5, 6, 8, 9, 10],
181
- };
182
- },
183
- methods: {
184
- onShowPaly(b) {
185
- this.isShowPaly = b;
186
- },
187
- trackPlayEvent(e) {
188
- console.log(e);
189
- },
190
- loadMap(e){
191
- // this.model={
192
- // id:1,
193
- // url:require('@/assets/layer1.png'),
194
- // bbox:bboxs[0],
195
- // zIndex:10,
196
- // };
197
- // this.kmlDto={
198
- // bbox:[119.4830523878688,30.17494943404726,119.5172307870407,30.20294858200727],
199
- // id: 'workId',
200
- // url:'http://localhost:7601/1.kml',
201
- // gcj02Url:'http://localhost:7601/1.kml'
202
- // };
203
- },
204
- load(obj) {
205
- console.log(obj);
206
- this.lMap = obj.mapServices;
207
- this.map = obj.map;
208
- setTimeout(r => {
209
- this.lineData = LineObj;
210
- }, 3000);
211
- this.lineData = LineObj;
212
- },
213
- drawSuccess(obj) {
214
- this.polygonModel = {
215
- fillColor: '#000',
216
- stroke: '#fff',
217
- width: 4,
218
- text: '',
219
- geo: obj.geoJson,
220
- id: 'ceshi',
221
- };
222
- },
223
- drawError(obj) {},
224
- mapClick(e) {
225
- console.log('ee========',e);
226
- // alert(e);
227
- },
228
- onLoad(e) {},
229
- crossHairClick(e) {
230
- // console.log(e);
231
- },
232
- mapMoveend(e) {
233
- // alert(1);
234
- console.log(e);
235
- },
236
- loadDrawPolygonEvent(e) {
237
- this.mapTool = e;
238
- },
239
- clusterCallback({
240
- id,
241
- isShow
242
- }) {
243
- setTimeout(r => {
244
- this.showPolygon = {
245
- id,
246
- isShow
247
- };
248
- this.isCheckPoint = {
249
- id,
250
- isShow
251
- };
252
- }, 50);
253
- },
254
- changeSwitchMap(obj) {
255
- if (obj.mapType == 2) {
256
- this.gpsType = 0;
257
- return;
258
- }
259
- this.gpsType = obj.mapType;
260
- },
261
- onClick() {
262
- this.isRyMapTool = !this.isRyMapTool;
263
- },
264
- onClick2() {
265
- this.maxZoom = 28;
266
- },
267
- onClick3() {
268
- this.maxZoom = 10;
269
- },
270
-
271
- }
272
- };
273
- </script>
274
-
275
- <style lang="scss" scoped>
276
- .map-style {
277
- height: 100vh;
278
- position: relative;
279
- }
280
- </style>