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