Edit features in 3D with the Editor widget
This sample shows how to use the Editor widget in 3D. This widget is useful as it provides an out-of-the-box experience to help streamline the editing experience within an application.
How it works
The widget automatically recognizes if there are any editable feature layer(s) within the scene. If there are, the layer or layers will display within the widget. Based on the editing functionality set on the feature layer, you can Edit
existing features and/or Add
new features.
The Editor widget uses the same coding pattern as other widgets, i.e. you must specify the view to be used by the widget.
Lastly, we add the widget to application using the View's UI.
When points use 3D object symbol layer, the editing tool allows you to configure size and rotation interactively by using the 3D manipulators:
For the editing tool to identify the size and the rotation, you need to set them as visual variables in the renderer:
For more samples, see Edit features with the Editor widget and Editor widget with configurations.
Snapping
It is also possible to configure snapping within the Editor
widget. This is handled via the snappingOptions property. Since the Editor does not yet provide a UI to configure snapping capabilities, this sample contains checkbox input elements to toggle snapping functionality on/off, and to specify if snapping should be limited to self or feature snapping.
Checking on the "Snapping enabled" checkbox is equivalent to setting the snappingOptions.enabled to true. You can also use the CTRL
key to dynamically toggle snapping on/off.