AnsweredAssumed Answered

Custom widget url creation

Question asked by gus6177 on Jan 5, 2018

I have the following function and when it's executed it returns SEE URL Below (A).  My GP service returns  SEE below  (B)  I'm thinking when the url that gets built and passed to the GP service it has the "geometryType":null

at the end its causing the GP service to fail.  Does anyone know why the "geometryType":null is added to the end of the url?  I looked at the API and tried adding "env:outSR":102100 to my var params but that didn't help.

//execute gp
executeGP: function (rs) {
    this.shelter.show();
    this.map.graphics.clear();
    var featureSet = new FeatureSet();
    var gra = new Graphic(null, null, rs, null);
    featureSet.features = [gra];
    featureSet.fields = [
        {
            name: "OBJECTID",
            alias: "OBJECTID",
            type: "esriFieldTypeOID"
        }, {
            //name: "Corridor",
            name: "Corridor",
            alias: "Corridor",
            type: "esriFieldTypeString",
            length: 8
        }, {
            name: "from_offset",
            alias: "from_offset",
            type: "esriFieldTypeSingle"
        }, {
            name: "to_offset",
            alias: "to_offset",
            type: "esriFieldTypeSingle"
        }
    ];
    var params = {
        "Route_Points": featureSet,
       
    };
    this.gp.submitJob(params, lang.hitch(this, this.processGP));
},

(A) Returns the following url.  :https://app.mdt.mt.gov/arcgis/rest/services/LRS/ReturnRouteSegment/GPServer/segment/submitJob?f=json&env:outSR=102100&Route_Points={"fields":[{"name":"OBJECTID","alias":"OBJECTID","type":"esriFieldTypeOID"},{"name":"Corridor","alias":"Corridor","type":"esriFieldTypeString","length":8},{"name":"from_offset","alias":"from_offset","type":"esriFieldTypeSingle"},{"name":"to_offset","alias":"to_offset","type":"esriFieldTypeSingle"}],"features":[{"attributes":{"OBJECTID":1,"Corridor":"C000001E","from_offset":"100","to_offset":"200"}}],"geometryType":null}
({
"paramName": "Route_Points_Events1",
"dataType": "GPFeatureRecordSetLayer",
"value": {
  "displayFieldName": "",
  "geometryType": "esriGeometryPolyline",
  "spatialReference": {
   "wkid": 102100,
   "latestWkid": 3857
  },
  "fields": [
   {
    "name": "OBJECTID",
    "type": "esriFieldTypeOID",
    "alias": "OBJECTID"
   },
   {
    "name": "Corridor",
    "type": "esriFieldTypeString",
    "alias": "Corridor",
    "length": 8
   },
   {
    "name": "from_offset",
    "type": "esriFieldTypeSingle",
    "alias": "from_offset"
   },
   {
    "name": "to_offset",
    "type": "esriFieldTypeSingle",
    "alias": "to_offset"
   },
   {
    "name": "LOC_ERROR",
    "type": "esriFieldTypeString",
    "alias": "LOC_ERROR",
    "length": 50
   },
   {
    "name": "Shape_Length",
    "type": "esriFieldTypeDouble",
    "alias": "Shape_Length"
   }
  ],
  "features": [{
   "attributes": {
    "OBJECTID": 1,
    "Corridor": "C000001E",
    "from_offset": 100,
    "to_offset": 200,
    "LOC_ERROR": "NO ERROR",
    "Shape_Length": 241333.05456719542
   },
   "geometry": {"paths": [[
    [
     -1.2763657977400001E7,
     6122093.660400003B)
]
   ]]}
  }],
  "exceededTransferLimit": false
}
}

Outcomes