Hide Table of Contents
View Default editing widget sample in sandbox
Default editing widget


The editor widget is a highly customizable object that provides the ability to create and edit features. This sample shows how to work with the basic editing functionality.

The editor widget constructor takes an input parameter called params, where the developer defines the functionality the application will include. In this case only the required options are defined. The required options are the map, the feature layers to edit, and the url to a geometry service.

Once the settings object is created you can create a new editor widget and pass in the settings and the div where the editor widget will be located.

Snapping is enabled for the editor using the map's enableSnapping()method.

Once created application users can perform the following tasks with the editor widget:

  • View and edit attributes
  • Add and delete feature attachments (images, pdf, etc)
  • Create new features
  • Edit and delete vertices


<!DOCTYPE html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
    <title>Default Editor</title>

    <link rel="stylesheet" href="https://js.arcgis.com/3.46/dijit/themes/claro/claro.css">
    <link rel="stylesheet" href="https://js.arcgis.com/3.46/esri/css/esri.css">
      html, body {
        height: 100%;
        width: 100%;
        margin: 0;

      body {
        background-color: #fff;
        overflow: hidden;
        font-family: Helvetica, san-serif;

      #templatePickerPane {
        width: 225px;
        overflow: hidden;

      #panelHeader {
        background-color: #92A661;
        border-bottom: solid 1px #92A860;
        color: #FFF;
        font-size: 18px;
        height: 24px;
        line-height: 22px;
        margin: 0;
        overflow: hidden;
        padding: 10px 10px 10px 10px;

      #map {
        margin-right: 5px;
        padding: 0;

      .esriEditor .templatePicker {
        padding-bottom: 5px;
        padding-top: 5px;
        height: 500px;
        border-radius: 0px 0px 4px 4px;
        border: solid 1px #92A661;

      .dj_ie .infowindow .window .top .right .user .content, .dj_ie .simpleInfoWindow .content {
        position: relative;

    <script src="https://js.arcgis.com/3.46/"></script>
      var map;

      ], function (
        esriConfig, Map, SnappingManager, Editor, FeatureLayer, GeometryService,
        Draw, keys, parser, arrayUtils, i18n
        ) {


        //snapping is enabled for this sample - change the tooltip to reflect this
        i18n.toolbars.draw.start += "<br/>Press <b>CTRL</b> to enable snapping";
        i18n.toolbars.draw.addPoint += "<br/>Press <b>CTRL</b> to enable snapping";

        //This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications
        esriConfig.defaults.geometryService = new GeometryService("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");

        map = new Map("map", {
          basemap: "topo-vector",
          center: [-77.036, 38.891],
          zoom: 16

        map.on("layers-add-result", initEditing);

        var operationsPointLayer = new FeatureLayer("https://services5.arcgis.com/lVkj5PBOw7tRmIPU/arcgis/rest/services/HSEC/FeatureServer/0", {
          mode: FeatureLayer.MODE_ONDEMAND,
          outFields: ["*"]
        var operationsLineLayer = new FeatureLayer("https://services5.arcgis.com/lVkj5PBOw7tRmIPU/arcgis/rest/services/HSEC/FeatureServer/1",{
          mode: FeatureLayer.MODE_ONDEMAND,
          outFields: ["*"]
        var operationsPolygonLayer = new FeatureLayer("https://services5.arcgis.com/lVkj5PBOw7tRmIPU/arcgis/rest/services/HSEC/FeatureServer/3", {
          mode: FeatureLayer.MODE_ONDEMAND,
          outFields: ["*"]

          operationsPointLayer, operationsPolygonLayer, operationsLineLayer
        map.infoWindow.resize(400, 300);

        function initEditing (event) {
          var featureLayerInfos = arrayUtils.map(event.layers, function (layer) {
            return {
              "featureLayer": layer.layer

          var settings = {
            map: map,
            layerInfos: featureLayerInfos
          var params = {
            settings: settings
          var editorWidget = new Editor(params, 'editorDiv');

          //snapping defaults to Cmd key in Mac & Ctrl in PC.
          //specify "snapKey" option only if you want a different key combination for snapping

  <body class="claro">
    <div id="mainWindow" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width:100%; height:100%;">
      <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
      <div data-dojo-type="dijit/layout/ContentPane" id="templatePickerPane" data-dojo-props="region:'left'">
        <div id="panelHeader">
          Default Editor
        <div style="padding:10px;" id="editorDiv">

Show Modal