Skip to content

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地图打印属性参数对象objectDEF_OPfalse
map影像地图object-true
  • DEF_OP属性

属性名说明类型可选值默认值
nameShow显示图名booleantrue
nameValue图名,仅在 nameShow=true 时生效string'默认图名'
companyShow显示制图单位booleantrue
companyValue制图单位名称,仅在 companyShow=true 时生效string'默认制图单位名称'
authorShow显示制图作者booleantrue
authorValue制图作者姓名,仅在 authorShow=true 时生效string'默认作者'
timeShow显示制图日期booleantrue
timeValue制图日期,仅在 timeShow=true 时生效numberDate.now()
coords显示坐标booleantrue
grid显示格网booleantrue
scaleBarShow显示比例尺booleantrue
scaleBarType比例尺类型,仅在 scaleBarShow=true 时生效stringbox'box'
northShow显示指北针booleantrue
northType指北针类型, 仅在 northShow=true 时生效stringnorth_0
north_1
north_2
north_3
'north_0'
dpi清晰度,正常输出为96number96
outType截图格式类型string.png/.jpeg'.png'
logo内置logostring 或 undefined内置logo

方法事件

事件名说明参数
@close-this关闭按钮事件-