ry-vue-map 0.2.2 → 0.2.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,4 +1,5 @@
1
1
  import 'ol/ol.css';
2
+ import Map from 'ol/Map';
2
3
  import {
3
4
  AM,
4
5
  BingMapsServices,
@@ -270,10 +271,31 @@ export default class LMapServices {
270
271
  });
271
272
 
272
273
  }
273
-
274
+
275
+ async initStaticMap(target,opt){
276
+ return await new Promise((res, rej) => {
277
+ setTimeout(r => {
278
+ const map = new Map({
279
+ target,
280
+ view: opt.view,
281
+ layers:[opt.layer],
282
+ });
283
+ this.map = map;
284
+ this.layers = [opt.layer];
285
+ if (map) {
286
+ res(map);
287
+ return;
288
+ }
289
+ rej(null);
290
+ }, 30);
291
+ });
292
+ }
293
+
274
294
  getVectorLayerView() {
275
295
  return MapConfig.getVectorLayerView;
276
296
  }
297
+
298
+
277
299
 
278
300
  onSetLayers(type) {
279
301
  this.type = type;
@@ -295,7 +317,7 @@ export default class LMapServices {
295
317
  });
296
318
  }
297
319
 
298
- onCreatePolygon(callback, type) {
320
+ onCreatePolygon(callback,isHideAreaAndKM=false) {
299
321
  if (this.polygonGeojson) {
300
322
  this.map.removeLayer(this.polygonGeojson);
301
323
  }
@@ -307,8 +329,7 @@ export default class LMapServices {
307
329
  this._lPolygon = new LPolygon(this.map, {
308
330
  strokeColor: 'rgba(255,201,14, 1)',
309
331
  fillColor: 'rgba(255,201,14, 0.4)',
310
- type
311
- });
332
+ },isHideAreaAndKM);
312
333
  return this._lPolygon;
313
334
  // if (callback) {
314
335
  // callback();
@@ -964,4 +985,4 @@ export default class LMapServices {
964
985
  }
965
986
  }
966
987
 
967
- }
988
+ }
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <div id="docx-demo">
3
+ <el-upload :limit="1" :file-list="fileList" accept=".docx" :beforeUpload="beforeUpload" action="">
4
+ <el-button size="small" type="warning">点击上传</el-button>
5
+ </el-upload>
6
+ <vue-office-docx :src="src" />
7
+ </div>
8
+ </template>
9
+
10
+ <script>
11
+ import VueOfficeDocx from '@vue-office/docx'
12
+ import '@vue-office/docx/lib/index.css'
13
+ export default {
14
+ components: {
15
+ VueOfficeDocx
16
+ },
17
+ data(){
18
+ return {
19
+ src:'',
20
+ fileList:[]
21
+ }
22
+ },
23
+ methods:{
24
+
25
+ beforeUpload(file){
26
+ let reader = new FileReader();
27
+ reader.readAsArrayBuffer(file);
28
+ reader.onload = (loadEvent) => {
29
+ let arrayBuffer = loadEvent.target.result;
30
+ this.src = arrayBuffer
31
+ };
32
+ return false
33
+ }
34
+ }
35
+ }
36
+ </script>
@@ -0,0 +1,26 @@
1
+ <template>
2
+ <vue-office-excel :src="excel" @rendered="rendered" style="height: 100vh;"/>
3
+ </template>
4
+
5
+ <script>
6
+ //引入VueOfficeExcel组件
7
+ import VueOfficeExcel from '@vue-office/excel'
8
+ //引入相关样式
9
+ import '@vue-office/excel/lib/index.css'
10
+
11
+ export default {
12
+ components:{
13
+ VueOfficeExcel
14
+ },
15
+ data(){
16
+ return {
17
+ excel: 'http://static.shanhuxueyuan.com/demo/excel.xlsx'//设置文档地址
18
+ }
19
+ },
20
+ methods:{
21
+ rendered(){
22
+ console.log("渲染完成")
23
+ }
24
+ }
25
+ }
26
+ </script>