leaflet-polydraw
Version:
Advanced Leaflet plugin for freehand polygon drawing, with smart merging and powerful editing tools. Compatible with both Leaflet v1.x and v2.x.
44 lines • 1.57 kB
TypeScript
/**
* Orchestrates polygon Transform Mode: capture original geometry, apply scale/rotation in pixel space,
* preview updates on the polygon, and support apply/cancel.
*/
import * as L from 'leaflet';
import { DonutDirection } from '../enums';
import { type DonutValidationResult } from './donut-validation';
export declare class PolygonTransformController {
private map;
private polygon;
private overlay;
private state;
private normalizedLatLngs;
private wasMapDraggingEnabled;
private mode;
private onExit?;
private rotateStartAngle;
private rotateBaseRotation;
private originalTouchAction;
private readonly mapDraggingHandler?;
private readonly originalPolygonStyle;
private readonly donutDirection;
constructor(map: L.Map, featureGroup: L.FeatureGroup, mode?: 'scale' | 'rotate' | 'donut', donutDirection?: DonutDirection, onExit?: (confirmed: boolean) => void);
destroy(): void;
private onKeyDown;
private updateOverlay;
private onStartDrag;
private onDrag;
private handleRotateDrag;
private handlePivotDrag;
private handleScaleDrag;
private preview;
apply(): L.LatLng[][][];
cancel(): void;
getMode(): 'scale' | 'rotate' | 'donut';
getOriginalOuterLatLngs(): L.LatLngLiteral[];
getScaledOuterLatLngs(): L.LatLngLiteral[];
getDonutValidation(): DonutValidationResult;
private syncDonutValidation;
private restorePolygonStyle;
private handleCancel;
private handleConfirm;
}
//# sourceMappingURL=polygon-transform-controller.d.ts.map