Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MarkerBase

Base class for all available and custom marker types.

All markers used with marker.js Live should be descendants of this class.

Hierarchy

Index

Constructors

constructor

  • new MarkerBase(container: SVGGElement): MarkerBase
  • Creates a new marker.

    Parameters

    • container: SVGGElement

      SVG container to hold marker's visual.

    Returns MarkerBase

Properties

Protected _container

_container: SVGGElement

Protected _outerContainer

_outerContainer: SVGGElement

Optional notes

notes: string

Additional information about the marker

onMarkerCreated

onMarkerCreated: (marker: MarkerBase) => void

Method called when marker creation is finished.

Type declaration

Static title

title: string

Marker type title (display name) used for accessibility and other attributes.

Static typeName

typeName: string = "MarkerBase"

String type name of the marker type.

Used when adding MarkerView.availableMarkerTypes via a string and to save and restore state.

Accessors

container

  • get container(): SVGGElement
  • SVG container object holding the marker's visual.

    Returns SVGGElement

outerContainer

  • get outerContainer(): SVGGElement
  • Outer SVG group container not manipulated or transformed by the marker itself in any way

    Returns SVGGElement

Methods

Protected addMarkerVisualToContainer

  • addMarkerVisualToContainer(element: SVGElement): void
  • Adds marker's root visual element to the container group.

    Parameters

    • element: SVGElement

      marker's visual element.

    Returns void

dblClick

  • dblClick(point: IPoint, target?: EventTarget): void
  • Handles pointer (mouse, touch, stylus, etc.) double click event.

    Parameters

    • point: IPoint

      event coordinates.

    • Optional target: EventTarget

      direct event target element.

    Returns void

deselect

  • deselect(): void
  • Deselects this marker.

    Returns void

dispose

  • dispose(): void
  • Disposes the marker and clean's up.

    Returns void

ownsTarget

  • ownsTarget(el: EventTarget): boolean
  • Returns true if passed SVG element belongs to the marker. False otherwise.

    Parameters

    • el: EventTarget

      target element.

    Returns boolean

pointerDown

  • pointerDown(point: IPoint, target?: EventTarget): void
  • Handles pointer (mouse, touch, stylus, etc.) down event.

    Parameters

    • point: IPoint

      event coordinates.

    • Optional target: EventTarget

      direct event target element.

    Returns void

pointerUp

  • pointerUp(point: IPoint): void
  • Handles pointer (mouse, touch, stylus, etc.) up event.

    Parameters

    • point: IPoint

      event coordinates.

    Returns void

restoreState

  • Restores previously saved marker state.

    Parameters

    Returns void

scale

  • scale(scaleX: number, scaleY: number): void
  • Scales marker. Used after the image resize.

    Parameters

    • scaleX: number

      horizontal scale

    • scaleY: number

      vertical scale

    Returns void

select

  • select(): void
  • Selects this marker.

    Returns void

Generated using TypeDoc