ry-vue-map 0.3.3 → 0.3.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.
@@ -1,82 +1,88 @@
1
1
  <template>
2
2
  <div class="map-style">
3
3
 
4
- <ry-map projection="EPSG:4326" :center="center" :zoom="15" :minZoom="1" :maxZoom="maxZoom" @load="load($event)"
4
+ <!-- <ry-map projection="EPSG:4326" :zoom="10" :minZoom="1" :maxZoom="maxZoom" :center="center" @load="load($event)"
5
5
  :isCrossHair="isRyMapTool" :isRight="true" :isRyMapTool="true" @drawSuccess="drawSuccess"
6
6
  @drawError="drawError" :isShowRangingTool="true" :isShowDrawTool="isRyMapTool" :bindMapClick="true"
7
7
  @mapClick="mapClick($event)" @crossHairClick="crossHairClick($event)" :bindMapMoveend="true"
8
- :isSwitchMapRight='true' :switchMapPosTop='60' :switchMapPosLeftOrRight="20" :switchMapHeight="40"  
9
- :switchMapDefaultTypeOrLayer="[1,2]" @mapMoveend="mapMoveend($event)"
10
- @loadDrawPolygonEvent="loadDrawPolygonEvent($event)" @changeSwitchMap="changeSwitchMap($event)"
11
- :isShowSwitchMap="true" @mapClick2="mapClick2($event)">
12
-
13
- <template #marker="{mapDto}">
14
-
15
- <!-- <ry-polygon-geo :isFit="true" :gpsType="gpsType" :map="mapDto.map" :model="polygonModel" :isStandardGeo="true" > </ry-polygon-geo> -->
16
- <!-- <RyKMLs v-if="kmlModels.length" :map="mapDto.map" :gpsType="gpsType" :modelArr="kmlModels" :isFit="true"
17
- :setColor="setColor" red="rykmls"></RyKMLs> -->
18
-
19
- <ry-static-layers :gpsType="gpsType" :map="mapDto.map" :modelArr="models" :isFit="true"></ry-static-layers>
20
- </template>
21
-
22
- </ry-map>
23
-
8
+ @mapMoveend="mapMoveend($event)" v-if="dto" :boundaryModel="dto" :urls="urls" :bbox="bbox">
9
+ </ry-map> -->
10
+
11
+ <RyStaticMap class="map-style" :url="url"
12
+ :minZoom="15" :maxZoom="18" :zoom="15.6" :center="center" @load="loadMap" @selectMapEvent="selectMapEvent">
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> -->
24
28
  </div>
25
29
  </template>
26
30
 
27
31
  <script>
28
32
  import dayjs from 'dayjs'
29
- import RyMap from '@/components/maps/ryMap/src/index.vue';
33
+ import RyStaticMap from '@/components/maps/ryStaticMap/src/index.vue';
30
34
  import RyMapTool from '@/components/maps/ryMapTool/src/index.vue';
31
35
  import RyPolygon from '@/components/maps/ryPolygon/src/index.vue';
32
36
  import RyPolygons from '@/components/maps/ryPolygons/src/index.vue';
33
37
  import RyClustersMarker from '@/components/maps/ryClustersMarker/src/index.vue';
34
38
  import RyPolygonGeo from '@/components/maps/ryPolygonGeo/src/index.vue';
35
- import geo from './ceshijson';
36
- import RyKMLs from '@/components/maps/ryKMLs/src/index.vue';
37
- import urls from './imgUrl';
38
- import RyStaticLayers from '@/components/maps/ryStaticLayers/src/index.vue';
39
- import {
40
- createPolygonBoundary,
41
- GPS,
42
- getLngAndLatMaxMin
43
- } from "ry-map";
44
- const polygonModel = {
45
- fillColor: 'transparent',
46
- stroke: '#F7B500',
47
- strokeWidth: 3,
48
- lineDash: [1, 2, 3, 4, 5, 6],
49
- geo: geo,
50
- id: 'ceshi5',
51
- };
39
+ import geoJson from "./330112";
40
+
52
41
 
53
- import {
54
- getCenter,
55
- getHeight,
56
- getWidth
57
- } from 'ol/extent';
58
42
 
59
43
  export default {
60
44
  components: {
61
- RyMap,
45
+ RyStaticMap,
62
46
  RyMapTool,
63
47
  RyPolygon,
64
48
  RyPolygons,
65
49
  RyClustersMarker,
66
50
  RyPolygonGeo,
67
- RyKMLs,
68
- RyStaticLayers
69
51
  },
70
52
  data() {
71
53
  return {
72
54
  map: null,
73
55
  lMap: null,
74
56
  polygonColorObj: null,
75
- bbox: [],
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],
76
62
  isClear: false,
77
- geoJson: null,
78
63
  colors: [],
79
- center: [121.28732413948202, 28.645057235065444],
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],
80
86
  polygonColors: [],
81
87
  remove: 'ceshi1',
82
88
  removes: [],
@@ -92,110 +98,68 @@
92
98
  }],
93
99
  inserts: [],
94
100
  isShowAll: false,
95
- // isShow:true,
96
- polygonModel: polygonModel,
101
+ polygonModel: null,
97
102
  mapTool: null,
98
103
  isCheckPoint: null,
99
- gpsType: 1,
104
+ gpsType: 0,
100
105
  isRyMapTool: true,
101
106
  maxZoom: 18,
102
- src: require("@/assets/1.png"),
103
- layerArr: [1, 2],
104
- kmlModels: [],
105
- setColor: null,
106
- models:[],
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
+ url: 'http://localhost:8601/uploads/5d53650724f04dd3b2d90a7adaddc87e.png',
107
129
  };
108
130
  },
109
131
  created() {
110
- console.log(urls);
111
- setTimeout(r => {
112
- this.models=[urls[0]];
113
- this.bbox=this.models[1].bbox;
114
- },3000);
115
- // setTimeout(r => {
116
- // this.kmlModels = [{
117
- // "bbox": [
118
- // 120.063902,
119
- // 30.860046,
120
- // 120.064164,
121
- // 30.860164,
122
- // "id": 1869,
123
- // "url":
124
- // "https://rydemo.ryaims.com:9443/ryfiles/81/b8c2429815344596ada3767f1668c438.kml",
125
- // "gcj02Url":
126
- // "https://rydemo.ryaims.com:9443/ryfiles/31/aed50d22cc6d4093b212184854f5b6ea.kml",
127
- // "width": "2",
128
- // "extractStyles": false,
129
- // "stroke": "rgb(6,108,211)",
130
- // "fillColor": "rgb(6,108,211)"
131
- // },
132
- // {
133
- // "bbox": [
134
- // 120.063138,
135
- // 30.858118,
136
- // 120.064633,
137
- // 30.859334
138
- // ],
139
- // "id": 1871,
140
- // "url": "https://rydemo.ryaims.com:9443/ryfiles/33/66f97d83f0e546b09c711abb4e1173e1.kml",
141
- // "gcj02Url": "https://rydemo.ryaims.com:9443/ryfiles/40/9eb63a47aba545f098139856bcbfd0a4.kml",
142
- // "width": "2",
143
- // "extractStyles": false,
144
- // "stroke": "rgb(12,217,166)",
145
- // "fillColor": "rgb(12,217,166)"
146
- // }
147
- // ];
148
- // }, 3000);
149
-
150
- // setTimeout(r => {
151
- // this.setColor = {
152
- // id: 1869,
153
- // color: '#000'
154
- // }
155
- // }, 5000);
156
-
157
- // setTimeout(r => {
158
- // this.setColor = {
159
- // id: 1871,
160
- // color: '#000'
161
- // }
162
- // }, 6000);
163
-
164
-
165
- // setTimeout(r=> {
166
- // this.$$refs.rykmls.setFit();
167
- // },8000);
168
-
132
+ this.dto = {
133
+ geo: geoJson,
134
+ width: 4,
135
+ color: '#000'
136
+ };
137
+ console.log(this.dto);
169
138
  },
170
139
  methods: {
140
+ async loadMap({
141
+ map,
142
+ mapServices
143
+ }) {
144
+ this.map = map;
145
+ this.lMap = mapServices;
146
+ },
171
147
  onShowPaly(b) {
172
148
  this.isShowPaly = b;
173
- },
174
- load(obj) {
175
- this.lMap = obj.mapServices;
176
- this.map = obj.map;
177
- // const geo2 = createPolygonBoundary(geo);
178
- // this.map.addLayer(geo2 );
179
149
 
180
- // console.log(geo2.getSource().getExtent());
181
- },
182
- getExtent() {
183
- const geometry = this.getGeometry();
184
- return geometry.getExtent();
185
150
  },
186
151
  drawSuccess(obj) {
187
- // this.polygonModel = {
188
- // fillColor: '#000',
189
- // stroke: '#fff',
190
- // width: 4,
191
- // text: '',
192
- // geo: obj.geoJson,
193
- // id: 'ceshi',
194
- // };
152
+ this.polygonModel = {
153
+ fillColor: '#000',
154
+ stroke: '#fff',
155
+ width: 4,
156
+ text: '',
157
+ geo: obj.geoJson,
158
+ id: 'ceshi',
159
+ };
195
160
  },
196
161
  drawError(obj) {},
197
162
  mapClick(e) {
198
- console.log(e);
199
163
  // alert(e);
200
164
  },
201
165
  onLoad(e) {},
@@ -203,9 +167,8 @@
203
167
  // console.log(e);
204
168
  },
205
169
  mapMoveend(e) {
206
-
207
170
  // alert(1);
208
- console.log(e);
171
+ // console.log(e);
209
172
  },
210
173
  loadDrawPolygonEvent(e) {
211
174
  this.mapTool = e;
@@ -233,21 +196,19 @@
233
196
  this.gpsType = obj.mapType;
234
197
  },
235
198
  onClick() {
236
- this.isRyMapTool = !this.isRyMapTool;
199
+ this.url="http://localhost:8601/uploads/5d53650724f04dd3b2d90a7adaddc87e.png";
200
+ // this.isRyMapTool = !this.isRyMapTool;
237
201
  },
238
202
  onClick2() {
239
- this.maxZoom = 28;
203
+ this.url="http://localhost:8601/uploads/23070b484f53466b9dd07c6757da9204.png";
204
+ // this.maxZoom = 28;
240
205
  },
241
206
  onClick3() {
242
207
  this.maxZoom = 10;
243
208
  },
244
- mapClick2(feature) {
245
- alert(1);
246
-
247
- // feature.get('ZLDWMC');
248
- console.log(feature.get('name'));
209
+ selectMapEvent(){
210
+
249
211
  }
250
-
251
212
  }
252
213
  };
253
214
  </script>
@@ -256,6 +217,5 @@
256
217
  .map-style {
257
218
  height: 100vh;
258
219
  position: relative;
259
-
260
220
  }
261
221
  </style>