new Screenshot(options)
view/utils/Screenshot.js, line 4
屏幕打印工具
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
构造参数
|
Example
// ES5引入方式
const { Map } = zondy
const { MapView } = zondy.leaflet
const { Screenshot } = zondy.leaflet.tool
// ES6引入方式
import { MapView, Screenshot } from "@mapgis/webclient-leaflet-plugin"
import { Map } from "@mapgis/webclient-common"
// 初始化图层管理容器
const map = new Map();
// 初始化地图视图对象
const mapView = new MapView({
// 视图id
viewId: "viewer-id",
// 图层管理容器
map: map
});
// 打印控件
const screenshot = new Screenshot({
view: mapView,
visible: true
})
// 添加控件
mapView.ui.add(screenshot)
Members
-
filename
-
浏览器下载文件名
-
format
-
打印图片类型,支持输出png、jpeg、svg格式图片
-
height
-
图片高度
-
isDownload
-
是否下载图片
-
view
-
视图对象
-
width
-
图片宽度
-
x
-
图片原点x
-
y
-
图片原点y