khajur

GeometryService Generalize tool

Discussion created by khajur on Feb 14, 2014
Latest reply on Feb 17, 2014 by khajur
I am running a query that results into a set of very complex geometries. I am trying to use the generalize tool from geometryservice
https://developers.arcgis.com/javascript/jsapi/geometryservice-amd.html#generalize to generalize each of the geometries.

Here is my partial code:
$.each(results.features, function (_key, _val) {{
     var generalizeParams = esri.tasks.GeneralizeParameters();
     generalizeParams.geometries = [_val.geometry];
     generalizeParams.maxDeviation = 0.05;
     getGeomService().generalize(generalizeParams, function (geometries) {
          _val.geometry = geometries;
     }, function (err) {
                        
     });
}

getGeomService() basically goes and gets the geometry service: return esri.config.defaults.geometryService;

When I run this, my FireBug goes to the error function and says:
SyntaxError: syntax error
The resource from this URL is not text: https://js.arcgis.com/3.8/

Any idea what I am doing wrong?

Outcomes