marker.js 3 Documentation
    Preparing search index...

    Class MarkerBaseEditor<TMarkerType>

    Base class for all marker editors.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Accessors

    Constructors

    Methods

    • Handles pointer (mouse, touch, stylus, etc.) double click event.

      Parameters

      • point: IPoint

        event coordinates.

      • Optionaltarget: EventTarget

        direct event target element.

      • Optionalev: MouseEvent

        pointer event.

      Returns void

    • Type guard for specific marker editor types.

      This allows to check if the editor is of a specific type which is useful for displaying type-specific UI.

      Type Parameters

      • T

        specific marker editor type.

      Parameters

      • cls: new (...args: any[]) => T

      Returns this is T

    • Returns true if the marker or the editor owns supplied target element.

      Parameters

      • el: null | EventTarget

        target element

      Returns boolean

    • Handles pointer (mouse, touch, stylus, etc.) down event.

      Parameters

      • point: IPoint

        event coordinates.

      • Optionaltarget: EventTarget

        direct event target element.

      • Optionalev: PointerEvent

        pointer event.

      Returns void

    Properties

    _container: SVGGElement

    SVG container for the marker's and editor's visual elements.

    _continuousCreation: boolean = false

    When set to true, a new marker of the same type is created immediately after the current one is finished.

    _controlBox: SVGGElement = ...

    SVG group holding editor's control box.

    _creationStyle: MarkerCreationStyle = 'draw'

    Marker creation style.

    Markers can either be created by drawing them or just dropping them on the canvas.

    _isSelected: boolean = false

    Is this marker selected?

    _marker: TMarkerType

    Marker instance.

    _markerType: new (container: SVGGElement) => TMarkerType

    Marker type constructor.

    Type declaration

      • new (container: SVGGElement): TMarkerType
      • Marker type constructor.

        Parameters

        • container: SVGGElement

        Returns TMarkerType

    _overlayContainer: HTMLDivElement

    Overlay container for HTML elements like text editors, etc.

    _state: MarkerEditorState = 'new'

    Editor's state.

    isMultiSelected: boolean = false

    Is this marker selected in a multi-selection?

    manipulationStartState?: string

    Marker's state when it is selected

    onMarkerCreated?: <T extends MarkerBaseEditor<MarkerBase>>(editor: T) => void

    Method called when marker creation is finished.

    onStateChanged?: <T extends MarkerBaseEditor<MarkerBase>>(editor: T) => void

    Method to call when marker state changes.