ShotGridMap - 成果打印
用于快速打印出图,支持图件信息、比例尺、格网和清晰度等设置
基础用法
vue
<template>
<div class="form-cus">
<ShotGridMap :map="map" :options="options"></ShotGridMap>
</div>
</template>
<script setup lang="ts">
const options = {
nameShow: true,
nameValue: '自定义图名',
companyShow: true,
companyValue: '自定义制图单位名称',
authorShow: true,
authorValue: '自定义作者',
timeShow: true,
timeValue: Date.now(),
coords: true,
grid: true,
scaleBarShow: true,
scaleBarType: 'box',
northShow: true,
northType: 'north_0',
dpi: 96,
outType: '.png',
logo: new URL('./assets/images/logo.png', import.meta.url).href,
}
</script>
属性参数
属性名 | 说明 | 类型 | 默认值 | Required |
---|---|---|---|---|
options | 地图打印属性参数对象 | object | DEF_OP | false |
map | 影像地图 | object | - | true |
DEF_OP属性
属性名 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
nameShow | 显示图名 | boolean | — | true |
nameValue | 图名,仅在 nameShow=true 时生效 | string | — | '默认图名' |
companyShow | 显示制图单位 | boolean | — | true |
companyValue | 制图单位名称,仅在 companyShow=true 时生效 | string | — | '默认制图单位名称' |
authorShow | 显示制图作者 | boolean | — | true |
authorValue | 制图作者姓名,仅在 authorShow=true 时生效 | string | — | '默认作者' |
timeShow | 显示制图日期 | boolean | — | true |
timeValue | 制图日期,仅在 timeShow=true 时生效 | number | — | Date.now() |
coords | 显示坐标 | boolean | — | true |
grid | 显示格网 | boolean | — | true |
scaleBarShow | 显示比例尺 | boolean | — | true |
scaleBarType | 比例尺类型,仅在 scaleBarShow=true 时生效 | string | box | 'box' |
northShow | 显示指北针 | boolean | — | true |
northType | 指北针类型, 仅在 northShow=true 时生效 | string | north_0 north_1 north_2 north_3 | 'north_0' |
dpi | 清晰度,正常输出为96 | number | — | 96 |
outType | 截图格式类型 | string | .png/.jpeg | '.png' |
logo | 内置logo | string 或 undefined | — | 内置logo |
方法事件
事件名 | 说明 | 参数 |
---|---|---|
@close-this | 关闭按钮事件 | - |