@bdh-gis/mapbox-gl-print
v1.5.1
Published
Print for mapbox controls
Downloads
91
Readme
🏷️ @bdh-gis/mapbox-gl-print
地图打印
npm i @bdh-gis/mapbox-gl-print
import Print from '@bdh-gis/mapbox-gl-print';
import '@bdh-gis/mapbox-gl-print/src/index.css';
map.addControl(new Print({
width: 100,
height: 100,
format: 'png',
dpi: 96,
isCreateCrosshair: true,
isCreatePrintArea: true
}));
Options
export type AnyEvent =
| 'CONTROL_BUTTON_CLICK'
| 'CREATE_BUTTONS'
| 'CREATE_PANEL'
| 'PANEL_CLOSE'
| 'PANEL_RESET'
| 'WIDTH_CHANGE'
| 'HEIGHT_CHANGE'
| 'FORMAT_CHANGE'
| 'DPI_CHANGE'
| 'PRINT';
export type Panel = {
header?: HTMLDivElement;
headerTitle?: HTMLDivElement;
headerClose?: HTMLDivElement;
body?: HTMLDivElement;
bodyEditRows?: {
row: HTMLDivElement;
rowLabel: HTMLDivElement;
rowValue: HTMLDivElement | HTMLInputElement | HTMLSelectElement;
}[];
bodyButtonsRow?: HTMLDivElement;
bodyButtons?: HTMLDivElement[];
width?: number;
height?: number;
format?: string;
dpi?: number;
crosshair?: CrosshairManager;
printArea?: PrintAreaManager;
};
export type Options = {
width?: number;
height?: number;
format?: string;
dpi?: number;
isCreateCrosshair?: boolean;
isCreatePrintArea?: boolean;
isCreateButtons?: boolean;
isCreatePanel?: boolean;
buttons?: Utils.ButtonOptions[];
panelContainer?: HTMLDivElement;
panel?: {
header: Utils.PanelOptions;
body: {
editRows: Utils.EditRow[];
buttonsRow: Utils.RowButton[];
};
};
onEvents?: (event: AnyEvent, data?: any) => void;
};