the editable site (validation-lab)
This commit is contained in:
commit
3ac81d5a52
13454 files changed
+2227005
No files matched your search
+126
@@ -0,0 +1,126 @@
|
||||
import { TerraDrawMouseEvent, TerraDrawAdapterStyling, TerraDrawKeyboardEvent, HexColorStyling, NumericStyling, Cursor, Snapping } from "../../common";
|
||||
import { TerraDrawBaseDrawMode, BaseModeOptions, CustomStyling, PointerEvents, ModeUpdateOptions } from "../base.mode";
|
||||
import { BehaviorConfig } from "../base.behavior";
|
||||
import { GeoJSONStoreFeatures, StoreValidation } from "../../store/store";
|
||||
type TerraDrawPolygonModeKeyEvents = {
|
||||
cancel?: KeyboardEvent["key"] | null;
|
||||
finish?: KeyboardEvent["key"] | null;
|
||||
};
|
||||
type PolygonStyling = {
|
||||
fillColor: HexColorStyling;
|
||||
fillOpacity: NumericStyling;
|
||||
outlineColor: HexColorStyling;
|
||||
outlineOpacity: NumericStyling;
|
||||
outlineWidth: NumericStyling;
|
||||
closingPointWidth: NumericStyling;
|
||||
closingPointColor: HexColorStyling;
|
||||
closingPointOpacity: NumericStyling;
|
||||
closingPointOutlineWidth: NumericStyling;
|
||||
closingPointOutlineColor: HexColorStyling;
|
||||
closingPointOutlineOpacity: NumericStyling;
|
||||
snappingPointWidth: NumericStyling;
|
||||
snappingPointColor: HexColorStyling;
|
||||
snappingPointOpacity: NumericStyling;
|
||||
snappingPointOutlineWidth: NumericStyling;
|
||||
snappingPointOutlineColor: HexColorStyling;
|
||||
snappingPointOutlineOpacity: NumericStyling;
|
||||
editedPointWidth: NumericStyling;
|
||||
editedPointColor: HexColorStyling;
|
||||
editedPointOpacity: NumericStyling;
|
||||
editedPointOutlineWidth: NumericStyling;
|
||||
editedPointOutlineColor: HexColorStyling;
|
||||
editedPointOutlineOpacity: NumericStyling;
|
||||
coordinatePointWidth: NumericStyling;
|
||||
coordinatePointColor: HexColorStyling;
|
||||
coordinatePointOpacity: NumericStyling;
|
||||
coordinatePointOutlineWidth: NumericStyling;
|
||||
coordinatePointOutlineColor: HexColorStyling;
|
||||
coordinatePointOutlineOpacity: NumericStyling;
|
||||
};
|
||||
interface Cursors {
|
||||
start?: Cursor;
|
||||
close?: Cursor;
|
||||
dragStart?: Cursor;
|
||||
dragEnd?: Cursor;
|
||||
}
|
||||
interface TerraDrawPolygonModeOptions<T extends CustomStyling> extends BaseModeOptions<T> {
|
||||
snapping?: Snapping;
|
||||
pointerDistance?: number;
|
||||
keyEvents?: TerraDrawPolygonModeKeyEvents | null;
|
||||
pointerEvents?: PointerEvents;
|
||||
cursors?: Cursors;
|
||||
editable?: boolean;
|
||||
showCoordinatePoints?: boolean;
|
||||
}
|
||||
export declare class TerraDrawPolygonMode extends TerraDrawBaseDrawMode<PolygonStyling> {
|
||||
mode: string;
|
||||
private currentCoordinate;
|
||||
private currentId;
|
||||
private keyEvents;
|
||||
private cursors;
|
||||
private mouseMove;
|
||||
private showCoordinatePoints;
|
||||
private lastMouseMoveEvent;
|
||||
private snapping;
|
||||
private snappedPointId;
|
||||
private editable;
|
||||
private editedFeatureId;
|
||||
private editedFeatureCoordinateIndex;
|
||||
private editedSnapType;
|
||||
private editedInsertIndex;
|
||||
private editedPointId;
|
||||
private coordinatePoints;
|
||||
private lineSnapping;
|
||||
private coordinateSnapping;
|
||||
private featureSnapping;
|
||||
private degreeSnapping;
|
||||
private pixelDistance;
|
||||
private closingPoints;
|
||||
private clickBoundingBox;
|
||||
private mutateFeature;
|
||||
private readFeature;
|
||||
private undoRedo;
|
||||
constructor(options?: TerraDrawPolygonModeOptions<PolygonStyling>);
|
||||
updateOptions(options?: ModeUpdateOptions<TerraDrawPolygonModeOptions<PolygonStyling>>): void;
|
||||
private close;
|
||||
/** @internal */
|
||||
registerBehaviors(config: BehaviorConfig): void;
|
||||
/** @internal */
|
||||
start(): void;
|
||||
/** @internal */
|
||||
stop(): void;
|
||||
private updateSnappedCoordinate;
|
||||
undoSize(): number;
|
||||
clearHistory(): void;
|
||||
private pushHistorySnapshot;
|
||||
private updateSnappedGuidancePointFromLastMouseMove;
|
||||
private syncClosingPoints;
|
||||
undo(): void;
|
||||
redoSize(): number;
|
||||
redo(): void;
|
||||
/** @internal */
|
||||
onMouseMove(event: TerraDrawMouseEvent): void;
|
||||
private snapCoordinate;
|
||||
private polygonFilter;
|
||||
private onRightClick;
|
||||
private onLeftClick;
|
||||
/** @internal */
|
||||
onClick(event: TerraDrawMouseEvent): void;
|
||||
/** @internal */
|
||||
onKeyUp(event: TerraDrawKeyboardEvent): void;
|
||||
/** @internal */
|
||||
onKeyDown(): void;
|
||||
onDragStart(event: TerraDrawMouseEvent, setMapDraggability: (enabled: boolean) => void): void;
|
||||
/** @internal */
|
||||
onDrag(event: TerraDrawMouseEvent, _setMapDraggability: (enabled: boolean) => void): void;
|
||||
/** @internal */
|
||||
onDragEnd(event: TerraDrawMouseEvent, setMapDraggability: (enabled: boolean) => void): void;
|
||||
/** @internal */
|
||||
cleanUp(): void;
|
||||
/** @internal */
|
||||
styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
|
||||
afterFeatureAdded(feature: GeoJSONStoreFeatures): void;
|
||||
afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
|
||||
validateFeature(feature: unknown): StoreValidation;
|
||||
}
|
||||
export {};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
Reference in new issue
Block a user