import SplitFeatureWorkflow from "@arcgis/core/widgets/Editor/SplitFeatureWorkflow.js";const SplitFeatureWorkflow = await $arcgis.import("@arcgis/core/widgets/Editor/SplitFeatureWorkflow.js");- Inheritance:
- SplitFeatureWorkflow→
Workflow<SplitFeatureWorkflowData‚ SplitFeatureWorkflowStep>→ Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.34
A read-only class containing the logic used when splitting a selected feature using the Editor widget. The workflow has two steps. In the first step, the user sketches the geometry that will be used to split the feature. In the next step, the user can review the two resulting features and their attributes.
Currently only supported in 2D. Support is limited to splitting one feature at a time. Point features cannot be split. When using a polyline splitter geometry, all parts of a multipart feature must be split together. To split only specific parts of a multipart feature, use a polygon splitter geometry instead.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
activeFeature readonly | | |
data readonly inherited | D | |
declaredClass readonly inherited | ||
| | ||
formViewModel readonly | | |
hasNextStep readonly inherited | ||
hasPreviousStep readonly inherited | ||
layer readonly | | |
started readonly inherited | ||
stepId readonly inherited | S | |
type readonly | "split-feature" | |
activeFeature
The currently active feature. The active feature is highlighted in the view, and is assigned to the workflow's featureFormViewModel, so that the form shows and manages its attribute values.
data
- Type
- D
The shared workflow data. This can be either CreateFeaturesWorkflowData, UpdateWorkflowData, UpdateFeaturesWorkflowData, MergeFeaturesWorkflowData, or SplitFeatureWorkflowData.
defaultSplitterGeometryType
- Type
- SplitterGeometryType | null | undefined
Specifies the type of geometry to be drawn by the Sketch operation that is started automatically when the workflow is launched. The user has the option to begin a different Sketch operation with a different geometry type.
formViewModel
- Type
- FeatureFormViewModel
The instance of FeatureFormViewModel used by the workflow to manage the attributes of the resulting features.
layer
- Type
- EditorLayerUnion
The layer to which the feature being split belongs. This is also the layer to which the new feature created by the workflow will be added.
stepId
- Type
- S
The name of the current step in the workflow.
Methods
| Method | Signature | Class |
|---|---|---|
cancel inherited | cancel(options?: CancelWorkflowOptions): Promise<void> | |
commit inherited | commit(): Promise<void> | |
emit inherited | emit<Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean | |
hasEventListener inherited | hasEventListener<Type extends EventNames<this>>(type: Type): boolean | |
next inherited | next(): Promise<void> | |
on inherited | on<Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle | |
previous inherited | previous(options?: WorkflowPreviousOptions): Promise<void> | |
reset inherited | reset(): Promise<void> | |
setActiveFeature(feature: Graphic | null | undefined): Promise<void> | | |
start inherited | start(): Promise<any> |
cancel
- Signature
-
cancel (options?: CancelWorkflowOptions): Promise<void>
Cancels the active workflow.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| options | An object with the following properties. | |
emit
- Signature
-
emit <Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean
- Type parameters
- <Type extends EventNames<this>>
Emits an event on the instance. This method should only be used when creating subclasses of this class.
hasEventListener
- Signature
-
hasEventListener <Type extends EventNames<this>>(type: Type): boolean
- Type parameters
- <Type extends EventNames<this>>
Indicates whether there is an event listener on the instance that matches the provided event name.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| type | Type | The name of the event. | |
- Returns
- boolean
Returns true if the class supports the input event.
on
- Signature
-
on <Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle
- Type parameters
- <Type extends EventNames<this>>
Registers an event handler on the instance. Call this method to hook an event with a listener.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| type | Type | An event or an array of events to listen for. | |
| listener | EventedCallback<this["@eventTypes"][Type]> | The function to call when the event fires. | |
- Returns
- ResourceHandle
Returns an event handler with a
remove()method that should be called to stop listening for the event(s).Property Type Description remove Function When called, removes the listener from the event.
Example
view.on("click", function(event){ // event is the event handle returned after the event fires. console.log(event.mapPoint);}); previous
- Signature
-
previous (options?: WorkflowPreviousOptions): Promise<void>
Moves to the previous step in the workflow.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| options | Options when calling this method. | |
setActiveFeature
- Signature
-
setActiveFeature (feature: Graphic | null | undefined): Promise<void>
Sets the specified feature as the active feature in the workflow. Setting a feature as active causes it to become highlighted and to be assigned to the form view model.
The feature must be one of the two features resulting from the split operation — i.e., the instance of {module
/Graphic} associated with either the SplitFeatureWorkflowData.existingFeatureEdits or SplitFeatureWorkflowData.newFeatureEdits property of the workflow's data.