fuchengshen
2022-07-09 3a25c05b5ab837714f30469cdcb1e2a77d8d7f6c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<template>
  <mars-pannel :visible="true" right="10" top="10">
    <a-space>
      <mars-button @click="onBindMapDemo">Map上直接弹出</mars-button>
      <mars-button @click="onBindLayerDemo">图层上绑定</mars-button>
      <mars-button @click="onBindLayerDemo2">图层上预定义配置</mars-button>
      <mars-button @click="onBindLayerTemplateDemo">自定义模版</mars-button>
 
      <mars-button @click="onBindGraphicDemo1">Graphic上绑定</mars-button>
      <mars-button @click="onBindGraphicDemo2">Graphic上局部刷新</mars-button>
    </a-space>
  </mars-pannel>
  <mars-dialog width="calc(100% - 200px)" left="100" top="80" bottom="80" title="查看历史" v-model:visible="showLayer">
    <iframe src="http://marsgis.cn/" frameborder="0"></iframe>
  </mars-dialog>
</template>
 
<script setup lang="ts">
import { ref } from "vue"
import * as mapWork from "./map.js"
 
const showLayer = ref()
 
mapWork.eventTarget.on("showWebsite", function (event: any) {
  showLayer.value = event.showHistoryLayer
})
 
const onBindMapDemo = () => {
  mapWork.bindMapDemo()
}
 
const onBindLayerDemo = () => {
  mapWork.bindLayerDemo()
}
 
const onBindLayerDemo2 = () => {
  mapWork.bindLayerDemo2()
}
 
const onBindLayerTemplateDemo = () => {
  mapWork.bindLayerTemplateDemo()
}
 
const onBindGraphicDemo1 = () => {
  mapWork.bindGraphicDemo1()
}
 
const onBindGraphicDemo2 = () => {
  mapWork.bindGraphicDemo2()
}
</script>
<style scoped lang="less">
.ant-space {
  display: grid;
}
</style>