ns-mapbox-gl-export
Version:
This module adds control which can export PDF and images.
52 lines (51 loc) • 1.57 kB
TypeScript
import { IControl, Map as MapboxMap } from 'mapbox-gl';
import { Translation } from './local';
type ControlPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
type Options = {
PageSize: any;
PageOrientation: string;
Format: string;
DPI: number;
Crosshair?: boolean;
PrintableArea: boolean;
accessToken?: string;
Local?: 'de' | 'en' | 'fr' | 'fi' | 'sv' | 'vi';
logoURL?: string;
adjustment?: number;
exportFile?: (file: Blob | string | null) => void;
additionalProps?: Record<string, any>;
};
export default class MapboxExportControl implements IControl {
private controlContainer;
private exportContainer;
private crosshair;
private printableArea;
private map?;
private exportButton;
private closeButton;
private options;
private previousScaleValue;
constructor(options: Options);
getDefaultPosition: () => ControlPosition;
OnContainerClick(): void;
OnContainerRemove(): void;
OnRemovePrint(): void;
OnToggleCrossHair(): void;
getTranslation(): Translation;
private calculateScale;
private updateScaleOnZoom;
onAdd(map: MapboxMap): HTMLElement;
private resetToDefault;
private createSelection;
private createScaleRow;
private restorePreviousScaleValue;
private handleScaleInputChange;
private showErrorMessage;
private createTextInput;
onRemove(): void;
private onDocumentClick;
private toggleCrosshair;
private togglePrintableArea;
private updatePrintableArea;
}
export {};