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/findNearbyFeatures?layerId=0&location=%7B%22x%22%3A0%2C%22y%22%3A0%2C%22spatialReference%22%3A%7B%22wkid%22%3A3857%7D%7D&distance=10000&f=json
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!