the editable site (validation-lab)
This commit is contained in:
commit
3ac81d5a52
13454 files changed
+2227005
No files matched your search
+153
@@ -0,0 +1,153 @@
|
||||
import { TerraDrawMouseEvent, TerraDrawKeyboardEvent, TerraDrawAdapterStyling, HexColorStyling, NumericStyling, Cursor, Validation, Snapping, UrlStyling, DashArrayStyling, MarkerAnchorStyling } from "../../common";
|
||||
import { BaseModeOptions, CustomStyling, ModeUpdateOptions, TerraDrawBaseSelectMode } from "../base.mode";
|
||||
import { BehaviorConfig } from "../base.behavior";
|
||||
import { FeatureId, GeoJSONStoreFeatures } from "../../store/store";
|
||||
import { ResizeOptions } from "./behaviors/drag-coordinate-resize.behavior";
|
||||
type TerraDrawSelectModeKeyEvents = {
|
||||
deselect: KeyboardEvent["key"] | null;
|
||||
delete: KeyboardEvent["key"] | null;
|
||||
rotate: KeyboardEvent["key"][] | null;
|
||||
scale: KeyboardEvent["key"][] | null;
|
||||
};
|
||||
type ModeFlags = {
|
||||
feature?: {
|
||||
validation?: Validation;
|
||||
draggable?: boolean;
|
||||
rotateable?: boolean;
|
||||
scaleable?: boolean;
|
||||
selfIntersectable?: boolean;
|
||||
coordinates?: {
|
||||
snappable?: boolean | Snapping;
|
||||
midpoints?: boolean | {
|
||||
draggable?: boolean;
|
||||
};
|
||||
draggable?: boolean;
|
||||
resizable?: ResizeOptions;
|
||||
deletable?: boolean;
|
||||
};
|
||||
};
|
||||
};
|
||||
type SelectionStyling = {
|
||||
selectedPointColor: HexColorStyling;
|
||||
selectedPointWidth: NumericStyling;
|
||||
selectedPointOpacity: NumericStyling;
|
||||
selectedPointOutlineColor: HexColorStyling;
|
||||
selectedPointOutlineWidth: NumericStyling;
|
||||
selectedPointOutlineOpacity: NumericStyling;
|
||||
selectedMarkerUrl: UrlStyling;
|
||||
selectedMarkerHeight: NumericStyling;
|
||||
selectedMarkerWidth: NumericStyling;
|
||||
selectedMarkerAnchor: MarkerAnchorStyling;
|
||||
selectedLineStringColor: HexColorStyling;
|
||||
selectedLineStringWidth: NumericStyling;
|
||||
selectedLineStringOpacity: NumericStyling;
|
||||
selectedLineStringDash: DashArrayStyling;
|
||||
selectedPolygonColor: HexColorStyling;
|
||||
selectedPolygonFillOpacity: NumericStyling;
|
||||
selectedPolygonOutlineColor: HexColorStyling;
|
||||
selectedPolygonOutlineOpacity: NumericStyling;
|
||||
selectedPolygonOutlineWidth: NumericStyling;
|
||||
selectionPointWidth: NumericStyling;
|
||||
selectionPointColor: HexColorStyling;
|
||||
selectionPointOpacity: NumericStyling;
|
||||
selectionPointOutlineColor: HexColorStyling;
|
||||
selectionPointOutlineWidth: NumericStyling;
|
||||
selectionPointOutlineOpacity: NumericStyling;
|
||||
midPointColor: HexColorStyling;
|
||||
midPointOutlineColor: HexColorStyling;
|
||||
midPointOpacity: NumericStyling;
|
||||
midPointWidth: NumericStyling;
|
||||
midPointOutlineWidth: NumericStyling;
|
||||
midPointOutlineOpacity: NumericStyling;
|
||||
};
|
||||
interface Cursors {
|
||||
pointerOver?: Cursor;
|
||||
pointerOverFeature?: Cursor;
|
||||
pointerOverCoordinate?: Cursor;
|
||||
pointerOverResizeHandle?: Cursor;
|
||||
dragStart?: Cursor;
|
||||
dragEnd?: Cursor;
|
||||
insertMidpoint?: Cursor;
|
||||
}
|
||||
interface TerraDrawSelectModeOptions<T extends CustomStyling> extends BaseModeOptions<T> {
|
||||
pointerDistance?: number;
|
||||
flags?: {
|
||||
[mode: string]: ModeFlags;
|
||||
};
|
||||
keyEvents?: TerraDrawSelectModeKeyEvents | null;
|
||||
dragEventThrottle?: number;
|
||||
cursors?: Cursors;
|
||||
allowManualDeselection?: boolean;
|
||||
allowManualSelection?: boolean;
|
||||
}
|
||||
export declare class TerraDrawSelectMode extends TerraDrawBaseSelectMode<SelectionStyling> {
|
||||
mode: string;
|
||||
private allowManualDeselection;
|
||||
private allowManualSelection;
|
||||
private dragEventThrottle;
|
||||
private dragEventCount;
|
||||
private selected;
|
||||
private flags;
|
||||
private keyEvents;
|
||||
private cursors;
|
||||
private validations;
|
||||
private dragTarget;
|
||||
private selectionPoints;
|
||||
private midPoints;
|
||||
private coordinateSnap;
|
||||
private featuresAtMouseEvent;
|
||||
private pixelDistance;
|
||||
private clickBoundingBox;
|
||||
private dragFeature;
|
||||
private dragCoordinate;
|
||||
private rotateFeature;
|
||||
private scaleFeature;
|
||||
private dragCoordinateResizeFeature;
|
||||
private coordinatePoints;
|
||||
private lineSnap;
|
||||
private mutateFeature;
|
||||
private readFeature;
|
||||
private getPointerOverFeatureCursor;
|
||||
private getPointerOverCoordinateCursor;
|
||||
private getPointerOverResizeHandleCursor;
|
||||
constructor(options?: TerraDrawSelectModeOptions<SelectionStyling>);
|
||||
updateOptions(options?: ModeUpdateOptions<TerraDrawSelectModeOptions<SelectionStyling>>): void;
|
||||
selectFeature(featureId: FeatureId): void;
|
||||
setSelecting(): void;
|
||||
registerBehaviors(config: BehaviorConfig): void;
|
||||
deselectFeature(id: FeatureId): void;
|
||||
private deselect;
|
||||
private deleteSelected;
|
||||
private clearDragTargetAndCursor;
|
||||
private getSelectedFlags;
|
||||
private onRightClick;
|
||||
private select;
|
||||
private onLeftClick;
|
||||
/** @internal */
|
||||
start(): void;
|
||||
/** @internal */
|
||||
stop(): void;
|
||||
/** @internal */
|
||||
onClick(event: TerraDrawMouseEvent): void;
|
||||
private canScale;
|
||||
private canRotate;
|
||||
private preventDefaultKeyEvent;
|
||||
/** @internal */
|
||||
onKeyDown(event: TerraDrawKeyboardEvent): void;
|
||||
/** @internal */
|
||||
onKeyUp(event: TerraDrawKeyboardEvent): void;
|
||||
/** @internal */
|
||||
cleanUp(): void;
|
||||
/** @internal */
|
||||
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 */
|
||||
onMouseMove(event: TerraDrawMouseEvent): void;
|
||||
/** @internal */
|
||||
styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
|
||||
afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
|
||||
}
|
||||
export {};
|
||||
Reference in new issue
Block a user