the editable site (validation-lab)
This commit is contained in:
commit
3ac81d5a52
13454 files changed
+2227005
No files matched your search
+117
@@ -0,0 +1,117 @@
|
||||
import { TerraDrawMouseEvent, TerraDrawAdapterStyling, TerraDrawKeyboardEvent, HexColorStyling, NumericStyling, Cursor, Projection, DrawInteractions, OneDimensionalSnapping } from "../../common";
|
||||
import { GeoJSONStoreFeatures, StoreValidation } from "../../store/store";
|
||||
import { BaseModeOptions, CustomStyling, ModeUpdateOptions, TerraDrawBaseDrawMode } from "../base.mode";
|
||||
import { BehaviorConfig } from "../base.behavior";
|
||||
type TerraDrawCircleModeKeyEvents = {
|
||||
cancel: KeyboardEvent["key"] | null;
|
||||
finish: KeyboardEvent["key"] | null;
|
||||
};
|
||||
type CirclePolygonStyling = {
|
||||
fillColor: HexColorStyling;
|
||||
fillOpacity: NumericStyling;
|
||||
outlineColor: HexColorStyling;
|
||||
outlineWidth: NumericStyling;
|
||||
outlineOpacity: NumericStyling;
|
||||
coordinatePointWidth: NumericStyling;
|
||||
coordinatePointColor: HexColorStyling;
|
||||
coordinatePointOpacity: NumericStyling;
|
||||
coordinatePointOutlineWidth: NumericStyling;
|
||||
coordinatePointOutlineColor: HexColorStyling;
|
||||
coordinatePointOutlineOpacity: NumericStyling;
|
||||
snappingPointColor: HexColorStyling;
|
||||
snappingPointWidth: NumericStyling;
|
||||
snappingPointOpacity: NumericStyling;
|
||||
snappingPointOutlineColor: HexColorStyling;
|
||||
snappingPointOutlineWidth: NumericStyling;
|
||||
snappingPointOutlineOpacity: NumericStyling;
|
||||
};
|
||||
interface Cursors {
|
||||
start?: Cursor;
|
||||
}
|
||||
interface TerraDrawCircleModeOptions<T extends CustomStyling> extends BaseModeOptions<T> {
|
||||
keyEvents?: TerraDrawCircleModeKeyEvents | null;
|
||||
cursors?: Cursors;
|
||||
startingRadiusKilometers?: number;
|
||||
projection?: Projection;
|
||||
drawInteraction?: DrawInteractions;
|
||||
segments?: number;
|
||||
showCoordinatePoints?: boolean;
|
||||
snapping?: OneDimensionalSnapping;
|
||||
}
|
||||
export declare class TerraDrawCircleMode extends TerraDrawBaseDrawMode<CirclePolygonStyling> {
|
||||
mode: string;
|
||||
private center;
|
||||
private endPosition;
|
||||
private segments;
|
||||
private currentCircleId;
|
||||
private keyEvents;
|
||||
private cursors;
|
||||
private startingRadiusKilometers;
|
||||
private cursorMovedAfterInitialCursorDown;
|
||||
private drawInteraction;
|
||||
private drawType;
|
||||
private cancelled;
|
||||
private minimumSegments;
|
||||
private showCoordinatePoints;
|
||||
private snapping;
|
||||
private snappedPointId;
|
||||
private readFeature;
|
||||
private coordinatePoints;
|
||||
private mutateFeature;
|
||||
private pixelDistance;
|
||||
private clickBoundingBox;
|
||||
private coordinateSnapping;
|
||||
private lineSnapping;
|
||||
private featureSnapping;
|
||||
/**
|
||||
* Create a new circle mode instance
|
||||
* @param options - Options to customize the behavior of the circle mode
|
||||
* @param options.keyEvents - Key events to cancel or finish the mode
|
||||
* @param options.cursors - Cursors to use for the mode
|
||||
* @param options.styles - Custom styling for the circle
|
||||
* @param options.pointerDistance - Distance in pixels to consider a pointer close to a vertex
|
||||
* @param options.startingRadiusKilometers - The starting radius of the circle in kilometers
|
||||
* @param options.projection - The map projection being used
|
||||
* @param options.showCoordinatePoints - Render a point at each circle vertex
|
||||
* @param options.drawInteraction - The type of draw interaction to use
|
||||
* @param options.snapping - Snapping options applied to the circle center coordinate
|
||||
*
|
||||
*/
|
||||
constructor(options?: TerraDrawCircleModeOptions<CirclePolygonStyling>);
|
||||
updateOptions(options?: ModeUpdateOptions<TerraDrawCircleModeOptions<CirclePolygonStyling>>): void;
|
||||
private close;
|
||||
private beginDrawing;
|
||||
private dragDrawAllowed;
|
||||
private moveDrawAllowed;
|
||||
/** @internal */
|
||||
start(): void;
|
||||
/** @internal */
|
||||
stop(): void;
|
||||
/** @internal */
|
||||
onClick(event: TerraDrawMouseEvent): void;
|
||||
/** @internal */
|
||||
onMouseMove(event: TerraDrawMouseEvent): void;
|
||||
private updateSnappedCoordinate;
|
||||
private deleteSnappedPoint;
|
||||
private getSnappedCoordinate;
|
||||
/** @internal */
|
||||
onKeyDown(): void;
|
||||
/** @internal */
|
||||
onKeyUp(event: TerraDrawKeyboardEvent): 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 */
|
||||
cleanUp(): void;
|
||||
/** @internal */
|
||||
styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
|
||||
validateFeature(feature: unknown): StoreValidation;
|
||||
private updateCircle;
|
||||
afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
|
||||
afterFeatureAdded(feature: GeoJSONStoreFeatures): void;
|
||||
registerBehaviors(config: BehaviorConfig): void;
|
||||
}
|
||||
export {};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
Reference in new issue
Block a user