Sketch component

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.

1
2
3
4
<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.

sketch-widget

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.

description-sketch-snapping-ui

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

The developer dashboard has moved

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close