1

I am using 'queryTask.execute' to get features from a layer. And have change the geometry-paths of the features(polyline), trying to save the changes using 'applyEdits'. This is throwing error 'esri.geometry.normalizeCentralMeridian: 'geometryService' argument is missing'. Updating any attribute is working while path edit is not working.

queryTask.execute(query, function(data){
    if(data.features && data.features.length){
            for(let i in data.features){
                connectedBoxIds = data.features[i].attributes.connectedBoxId.split(',');
                pathIndex = Number(connectedBoxIds.indexOf(componentId)) + 1;
                data.features[i].geometry.paths[0][pathIndex] = newVertex;
            }
            var resultLayer = wireLayer.applyEdits(null, data.features, null);
            resultLayer.then(_ => {
                console.log(_);
            }).otherwise(err => console.warn('error', err));

        }
    });
    queryTask.on('error', lang.hitch(this, 'queryTaskErrorHandler'));
1

the error is asking you to specify a valid geometry service in your application in order to manipulate/correct the polyline prior to saving the edit.

Geometry services ship out of the box with ArcGIS Server, but you're also welcome to point at a utility instance associated with ArcGIS Online if you prefer.

esriConfig.geometryService = "http://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer";

more info: https://developers.arcgis.com/javascript/3/jsapi/esri.config-amd.html

3
  • I am using 'npmjs.com/package/generator-arcgis-js-app' to set up a dojo argis project. And I am able to edit any feature loaded by default. Hope I must be there in config Sep 14 '16 at 10:09
  • you shouldn't expect it to be exposed via a config. you'll need to write the code yourself. i'd suggest placing it in 'src/app/components/map/MapView.js' Sep 15 '16 at 18:23
  • Thanks for all your answers, John. But for my issue 'selectFeatures(query, selectionMethod?, callback?, errback?)' is working fine instead of 'queryTask'. This returns graphics as we loop through the graphics of a layer. Sep 16 '16 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.