@vernonia/core - v5.1.12
    Preparing search index...

    Extended sketch view model for sketch.

    Hierarchy

    • SketchViewModel
      • default
    Index

    Constructors

    Properties

    activeCreateToolDrawMode: "hybrid" | "click" | nullish | "freehand"

    When creating new graphics (for example after create() has been called), this property reflects the drawing mode being used.

    Read more...

    activeTool:
        | "transform"
        | "move"
        | "circle"
        | "polygon"
        | "polyline"
        | nullish
        | "point"
        | "rectangle"
        | "multipoint"
        | "mesh"
        | "reshape"
        | "freehandPolyline"
        | "freehandPolygon"

    When creating new graphics (for example after create() has been called), this property reflects the create tool being used.

    Read more...

    activeTooltip: nullish | Tooltip

    The tooltip currently being displayed for the activeTool.

    Read more...

    createGraphic: nullish | Graphic

    The graphic that is being created.

    Read more...

    creationMode: "update" | "single" | "continuous"

    Defines the default behavior once the create operation is completed.

    "single"

    Read more...

    declaredClass: string
    defaultCreateOptions: SketchViewModelDefaultCreateOptions

    Default create options set for the SketchViewModel.

    Read more...

    defaultUpdateOptions: SketchViewModelDefaultUpdateOptions

    Default update options set for the SketchViewModel.

    Read more...

    destroyed: boolean
    graphicsCount: number = 0
    initialized: boolean
    layer: GraphicsLayer = ...

    The GraphicsLayer associated with the SketchViewModel.

    Read more...

    layers: GroupLayer = ...
    point: GraphicsLayer = ...
    pointView: GraphicsLayerView
    polygon: GraphicsLayer = ...
    polygonView: GraphicsLayerView
    polyline: GraphicsLayer = ...
    polylineView: GraphicsLayerView
    state: "active" | "disabled" | "ready"

    The sketch view model's state.

    "disabled"

    Read more...

    text: GraphicsLayer = ...
    textSymbol: TextSymbol = TEXT_SYMBOL
    textView: GraphicsLayerView
    updateGraphics: Collection<Graphic>

    An array of graphics that are being updated by the SketchViewModel.

    Read more...

    updateOnGraphicClick: boolean = false

    Indicates if a graphic can be selected to be updated.

    Read more...

    view: nullish | MapView | SceneView

    The view in which geometries will be sketched by the user.

    Read more...

    Accessors

    • get activeFillSymbol(): nullish | SimpleFillSymbol | CIMSymbol

      The SimpleFillSymbol displayed when actively creating a new polygon graphic using the polygon tool.

      Read more...

      Returns nullish | SimpleFillSymbol | CIMSymbol

    • set activeFillSymbol(
          value:
              | nullish
              | SimpleFillSymbolProperties & { type: "simple-fill" }
              | CIMSymbolProperties & { type: "cim" },
      ): void

      Parameters

      • value:
            | nullish
            | SimpleFillSymbolProperties & { type: "simple-fill" }
            | CIMSymbolProperties & { type: "cim" }

      Returns void

    • get labelOptions(): SketchLabelOptions

      Options to configure the sketch labels shown next to each segment of the geometry being created or updated.

      Read more...

      Returns SketchLabelOptions

    • set labelOptions(value: SketchLabelOptionsProperties): void

      Parameters

      • value: SketchLabelOptionsProperties

      Returns void

    • get pointSymbol(): | PictureMarkerSymbol
      | SimpleMarkerSymbol
      | TextSymbol
      | CIMSymbol
      | PointSymbol3D
      | WebStyleSymbol

      A SimpleMarkerSymbol, PointSymbol3D, TextSymbol, CIMSymbol, or WebStyleSymbol used for representing the point geometry that is being drawn.

      Read more...

      Returns
          | PictureMarkerSymbol
          | SimpleMarkerSymbol
          | TextSymbol
          | CIMSymbol
          | PointSymbol3D
          | WebStyleSymbol

    • set pointSymbol(
          value:
              | SimpleMarkerSymbolProperties & { type: "simple-marker" }
              | PictureMarkerSymbolProperties & { type: "picture-marker" }
              | PointSymbol3DProperties & { type: "point-3d" }
              | TextSymbolProperties & { type: "text" }
              | CIMSymbolProperties & { type: "cim" }
              | WebStyleSymbolProperties & { type: "web-style" },
      ): void

      Parameters

      • value:
            | SimpleMarkerSymbolProperties & { type: "simple-marker" }
            | PictureMarkerSymbolProperties & { type: "picture-marker" }
            | PointSymbol3DProperties & { type: "point-3d" }
            | TextSymbolProperties & { type: "text" }
            | CIMSymbolProperties & { type: "cim" }
            | WebStyleSymbolProperties & { type: "web-style" }

      Returns void

    • get polygonSymbol(): SimpleFillSymbol | CIMSymbol | PolygonSymbol3D

      A SimpleFillSymbol, PolygonSymbol3D, or CIMSymbol used for representing the polygon geometry that is being drawn.

      Read more...

      Returns SimpleFillSymbol | CIMSymbol | PolygonSymbol3D

    • set polygonSymbol(
          value:
              | SimpleFillSymbolProperties & { type: "simple-fill" }
              | PolygonSymbol3DProperties & { type: "polygon-3d" }
              | CIMSymbolProperties & { type: "cim" },
      ): void

      Parameters

      • value:
            | SimpleFillSymbolProperties & { type: "simple-fill" }
            | PolygonSymbol3DProperties & { type: "polygon-3d" }
            | CIMSymbolProperties & { type: "cim" }

      Returns void

    • get polylineSymbol(): SimpleLineSymbol | CIMSymbol | LineSymbol3D

      A SimpleLineSymbol, LineSymbol3D, or CIMSymbol used for representing the polyline geometry that is being drawn.

      Read more...

      Returns SimpleLineSymbol | CIMSymbol | LineSymbol3D

    • set polylineSymbol(
          value:
              | SimpleLineSymbolProperties & { type: "simple-line" }
              | LineSymbol3DProperties & { type: "line-3d" }
              | CIMSymbolProperties & { type: "cim" },
      ): void

      Parameters

      • value:
            | SimpleLineSymbolProperties & { type: "simple-line" }
            | LineSymbol3DProperties & { type: "line-3d" }
            | CIMSymbolProperties & { type: "cim" }

      Returns void

    • get snappingOptions(): SnappingOptions

      The SnappingOptions for sketching.

      Read more...

      Returns SnappingOptions

    • set snappingOptions(value: SnappingOptionsProperties): void

      Parameters

      • value: SnappingOptionsProperties

      Returns void

    • get tooltipOptions(): SketchTooltipOptions

      Options to configure the tooltip shown next to the cursor when creating or updating graphics.

      Read more...

      Returns SketchTooltipOptions

    • set tooltipOptions(value: SketchTooltipOptionsProperties): void

      Parameters

      • value: SketchTooltipOptionsProperties

      Returns void

    • get valueOptions(): SketchValueOptions

      Options to configure how values are displayed and input when creating or updating graphics.

      Read more...

      Returns SketchValueOptions

    • set valueOptions(value: SketchValueOptionsProperties): void

      Parameters

      • value: SketchValueOptionsProperties

      Returns void

    Methods

    • Parameters

      • propertyName: string

      Returns any

    • Type Parameters

      • T

      Parameters

      • propertyName: string

      Returns T

    • Type Parameters

      • T

      Parameters

      • propertyName: string
      • value: T

      Returns this

    • Type Parameters

      • T

      Parameters

      • handles: IHandle | IHandle[]
      • OptionalgroupKey: Exclude<T, IHandle>

      Returns void

    • Cancels the active operation and fires the create or update event If called in the middle of a create operation, cancel() discards the partially created graphic.

      Read more...

      Returns void

    • Indicates if it is possible to perform a redo() action in the current update session.

      Read more...

      Returns boolean

    • Indicates if it is possible to perform an undo() action in the current update session.

      Read more...

      Returns boolean

    • Completes the active operation and fires the create or update event and changes the event's state to complete.

      Read more...

      Returns void

    • Create a graphic with the geometry specified in the tool parameter.

      Parameters

      • tool:
            | "circle"
            | "polygon"
            | "polyline"
            | "point"
            | "rectangle"
            | "multipoint"
            | "mesh"
            | "freehandPolyline"
            | "freehandPolygon"

        Name of the create tool. Specifies the geometry for the graphic to be created.

      • OptionalcreateOptions: SketchViewModelCreateCreateOptions

        Options for the graphic to be created.

        Read more...

      Returns void

    • Deletes the selected graphics used in the update workflow.

      Read more...

      Returns void

    • Returns void

    • Duplicates current graphics used in the update workflow and automatically adds them to the associated layer.

      Read more...

      Returns void

    • Emits an event on the instance.

      Parameters

      • type: string

        The name of the event.

      • Optionalevent: any

        The event payload.

        Read more...

      Returns boolean

    • Indicates whether there is an event listener on the instance that matches the provided event name.

      Parameters

      Returns boolean

    • Type Parameters

      • T

      Parameters

      • OptionalgroupKey: Exclude<T, IHandle>

      Returns boolean

    • Parameters

      • propertyName: string

      Returns void

    • Parameters

      • name: "delete"
      • eventHandler: SketchViewModelDeleteEventHandler

      Returns IHandle

    • Parameters

      • name: "create"
      • eventHandler: SketchViewModelCreateEventHandler

      Returns IHandle

    • Parameters

      • name: "update"
      • eventHandler: SketchViewModelUpdateEventHandler

      Returns IHandle

    • Parameters

      • name: "redo"
      • eventHandler: SketchViewModelRedoEventHandler

      Returns IHandle

    • Parameters

      • name: "undo"
      • eventHandler: SketchViewModelUndoEventHandler

      Returns IHandle

    • Allows creation of a graphic similar to create with the difference that the geometry can be provided directly for the graphic being created.

      Parameters

      • geometry: Mesh

        Geometry to place when creating the graphic. Currently only mesh geometry is supported.

        Read more...

      Returns void

    • Incrementally redo actions recorded in the stack.

      Read more...

      Returns void

    • Type Parameters

      • T

      Parameters

      • OptionalgroupKey: Exclude<T, IHandle>

      Returns void

    • Type Parameters

      • T

      Parameters

      • propertyName: string
      • value: T

      Returns this

    • Parameters

      • props: HashMap<any>

      Returns this

    • Incrementally undo actions recorded in the stack.

      Read more...

      Returns void

    • Initializes an update operation for the specified graphic(s) and fires update event.

      Parameters

      • graphics: Graphic | Graphic[]

        A graphic or an array of graphics to be updated. Only graphics added to SketchViewModel's layer property can be updated.

      • OptionalupdateOptions: SketchViewModelUpdateUpdateOptions

        Update options for the graphics to be updated.

        Read more...

      Returns Promise<void>

    • Parameters

      • path: string | string[]
      • callback: WatchCallback
      • Optionalsync: boolean

      Returns WatchHandle