You are using a browser that is no longer supported. Please use the latest version of Google Chrome, Mozilla Firefox, Apple Safari, or Microsoft Edge. For more information please see the System Requirements.

Sketch widget

Unsupported browser

You are using a browser that is not supported. JavaScript API works on the latest versions of Google Chrome, Mozilla Firefox, Apple Safari, or Microsoft Edge. Use one of these browsers and provide your feedback through GeoNet, the Esri Community.

  • {i18n.unsupportedBrowser.chrome}
  • Firefox
  • Safari
  • undefined
Loading...

Note: Support for 3D on mobile devices may vary, view the system requirements for more information.

This sample demonstrates how to create new graphics or update existing graphics using Sketch widget in a 2D MapView. The same pattern is used for adding the widget to a SceneView. Sketch widget wires up all the relevant events for creating new graphics or updating existing graphics. This saves the effort of writings lots of code for creating and updating graphics.

To use the Sketch widget, create a new instance of the widget, and set its view and layer properties.

// create a new sketch widget
const sketch = new Sketch({
  view,
  layer: graphicsLayer
});

Once the application loads, you can start creating graphics with point, polyline, polygon, extent and circle geometries using relevant create tool. Once the graphics are created you can click on the graphic and start updating the graphic by rotating, scaling, moving or reshaping. You can also undo and redo your create and update operations while creating or updating the graphics.

sketch-widget

Sample search results

TitleSample
Loading...