This sample demonstrates how to create new graphics or update existing graphics using the Sketch component. The Sketch component wires up all the relevant events for creating new graphics or updating existing graphics.
To use the Sketch component, add it to a map component.
<arcgis-map center="139.5716,35.696" zoom="18">
<arcgis-sketch position="top-right" creation-mode="update">
</arcgis-sketch>
</arcgis-map>
Once the application loads, you can start creating graphics with point
, polyline
, polygon
, rectangle
and circle
geometries using their corresponding create tools. Once a graphic is created you can click on the graphic and start updating it by rotating
, scaling
, moving
or reshaping
. You can also undo
and redo
your create and update operations while creating or updating the graphics.
Additionally, you can take advantage of the selection tools (rectangle-selection
and lasso-selection
) to select one or more graphics at once.
Snapping
Snapping can be toggled on/off in this sample, with either the snapping options UI
in the Sketch
component, or while drawing and holding the Ctrl
key. Please refer to the SnappingOptions documentation for a list of known limitations, when working with
snapping and the Sketch
component.