类名 PrintControl

# new PrintControl(options)

打印工具

参数:

名称 类型 描述
options Object

构造参数

sizeModes Array.<String>

目前支持 ['Current', 'A4Landscape', 'A4Portrait']

filename String

打印文件名

exportOnly Boolean

是否仅导出

hideControlContainer Boolean

隐藏控件容器

查看源代码 leaflet/widgets/Print/PrintControl.js, line 4

示例

初始化打印工具

// ES5引入方式
const { Map, MapView } = Zondy
const { PrintControl } = Zondy.Widget
// ES6引入方式
import { Map, MapView, PrintControl } from "@mapgis/webclient-leaflet-plugin"
// 初始化图层管理容器
const map = new Map();
// 初始化地图视图对象
const mapView = new MapView({
  // 视图id
  viewId: "viewer-id",
  // 图层管理容器
  map: map
});
// 打印控件
const printControl = new PrintControl({
  view: mapView,
  visible: true
})
// 添加控件
mapView.ui.add(printControl)

继承关系

方法

# destroy()

销毁控件

Inherited From:

查看源代码 leaflet/Widget/Widget.js, line 38

构造函数
成员变量
方法
事件