ERROR 000735: analysisLayer: Value is required arcgis.js:62 ERROR 000735: nearLayer: Value is required arcgis.js:62 Failed.
var gp = new Geoprocessor("http://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer/FindNearest"); var _params = { "analysisLayer": { "url": "https://services1.arcgis.com/fcrLbZIfZI20fNqr/arcgis/rest/services/rig_subset_4326/FeatureServer/0" //"url": "http://10.4.164.20:6080/arcgis/rest/services/RigPlanner/RigPlanner_server/MapServer/0" //"filter" : "filter" }, "NearLayer": { "layerDefinition": { "geometryType": "esriGeometryPoint", "fields": [ { "name": "Id", "type": "esriFieldTypeOID", "alias": "Id" } ]}, "featureSet": { "geometryType": "esriGeometryPoint", "spatialReference": { "wkid": 4326 }, "features": [ { "geometry": { "x": -94.00, "y": 28.00 }, "attributes": { "Id": 1 } } ]} }, "maxCount": 10, "measurementType": "StraightLine", //"searchCutoff": 44, //"searchCutoffUnits": "Kilometers" "f": "json" } gp.submitJob(_params, completeCallback, statusCallback, errorCallback);
Solved! Go to Solution.
You can see my app for a limited period here: http://deloittegeospatial.github.io/
Code here: https://github.com/DeloitteGeospatial/deloittegeospatial.github.io/blob/master/js/arcgis.js
Getting published GP services to work is a whole different problem set. I'm sure you've seen these documents but I would start here:
http://resources.arcgis.com/en/help/main/10.2/index.html#/Analyzing_a_geoprocessing_service/00570000...