rlayers
Version:
React Components for OpenLayers
41 lines • 1.72 kB
TypeScript
import { MapBrowserEvent } from 'ol';
import { default as Modify, ModifyEvent } from 'ol/interaction/Modify';
import { StyleLike } from 'ol/style/Style';
import { default as RPointer } from './RPointer';
/**
* @propsfor RModify
*/
export interface RModifyProps {
/** An optionnal condition for triggering the interaction
* @default primaryAction */
condition?: (e: MapBrowserEvent<PointerEvent | KeyboardEvent | WheelEvent>) => boolean;
/** An optional OpenLayers condition to allow removal of the feature
* @default (altKeyOnly+singleClick) */
deleteCondition?: (e: MapBrowserEvent<PointerEvent | KeyboardEvent | WheelEvent>) => boolean;
/** An optional OpenLayers condition to allow adding of a vertex
* @default true */
insertVertexCondition?: (e: MapBrowserEvent<PointerEvent | KeyboardEvent | WheelEvent>) => boolean;
/**
* Style for rendering while drawing, supports only Openlayers styles.
* Once the interaction is finished, the resulting feature will adopt
* the style of its layer.
*/
style?: StyleLike;
/** Snap tolerance in pixels
* @default 10 */
pixelTolerance?: number;
/** True hit detection based on feature shape
* @default false */
hitDetection?: number;
/** Called on modify start */
onModifyStart?: (this: RModify, e: ModifyEvent) => void;
/** Called on modify end */
onModifyEnd?: (this: RModify, e: ModifyEvent) => void;
}
/** Pointer interaction for modifying existing features */
export default class RModify extends RPointer<RModifyProps> {
protected static classProps: string[];
ol: Modify;
createOL(props: RModifyProps): Modify;
}
//# sourceMappingURL=RModify.d.ts.map