Hi,
I have an SOE deployed and can call it fine using a browser using the following:
https://server/arcgis/rest/services/Testing/TestLayer/MapServer/exts/FeatureCountSOE/findNearbyFeatu...
That works fine and sends a json response with the feature count.
What I need is to replicate the call above but using the JS API, I have tried a few things but none seem to pass append the REST endpoint with the required parameters (layerId, location and distance), here's what I tried
var queryTask = new QueryTask({
url: "https://server/arcgis/rest/services/Testing/TestLayer/MapServer/exts/FeatureCountSOE/findNearbyFeatures",
layerId: 0,
distance: 10000,
location: "{'x':0,'y':0,'spatialReference':{'wkid':3857}}",
f: "json"
});
var query = new Query();
query.outFields = ["*"];
queryTask.execute(query).then(function(results){
alert(results);
});
Am I way off the mark? Feels like it 😕
Thanks for your help!