[GIS] How to edit lines containing M values with the ArcGIS JS API

arcgis-javascript-api

I am working with the ArcGIS JavaScript API and want to move and edit the vertices of a polyline analog to the following sample: http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_toolbar.html

This works fine as long as the polyline does not contain M Values. If it does contain M Values I get the following error in firebug.
Errorcode:-2147221399, description: „Geometry does not have M Value(s), hence cannot update the feature."

What am I doing wrong?

Here’s my code:

function initEditing(layers) {
    var myMap = this;
    var firePerimeterFL = myMap.getLayer("firePerimeterFL");

    var editToolbar = new esri.toolbars.Edit(myMap);
    dojo.connect(editToolbar, "onDeactivate", function(tool,graphic,info) {
      if(info.isModified){
        firePerimeterFL.applyEdits(null, [graphic], null);
      }
    });

    var editingEnabled = false;
    dojo.connect(firePerimeterFL, "onDblClick", function(evt) {
      dojo.stopEvent(evt);
      if (editingEnabled === false) {
        editingEnabled = true;
        editToolbar.activate(esri.toolbars.Edit.EDIT_VERTICES , evt.graphic);
      } else {
        editToolbar.deactivate();
        editingEnabled = false;
      }
    });
  }

Best Answer

Editing feature geometries with M values is not supported via REST (or SOAP for that matter) at 10.0. It is a planned feature for 10.1 (along with Z values). Here's the documentation for this: Authoring feature services

Specifically:

If you have data that has m-values, these features can be deleted, new features can be inserted and the attributes of existing features can be edited, but the geometry cannot be edited. All new features will have their m-values set to NaN when inserted through the REST and SOAP endpoints. If features with m-values are edited through the feature service in ArcMap with the local editing commands, all editing operations are supported.