Hi all,
I'm using leaflet to create a time series web map where a user can place a point on a map and the values at that lat and long will be graphed on the web page. I have a geoprocessing service that runs fine, I've tested it in arcmap and it works great it accepts lats and longs and spits out the extracted data values. I also have a web page that allows a user to create points and produces lats and longs to be passed back to the geoprocessing service. However I cannot get the two to talk to each other, can anyone here tell me what is wrong?
> However I cannot get the two to talk to each other.
are you saying you can't get your webpage to talk to ArcMap?
or are you saying you can't figure out how to invoke the GP service using the coordinates that the user drew in the esri-leaflet app?
The later. I accessed the GP service from ArcMap to test it.
you need to call Geoprocessing() from within your `addMarker()` function.
bonus points if you start passing through the latitude and longitude as arguments instead of relying on a global variable.
ex:
Geoprocessing(e.latlng.lng, e.latlng.lat)
// ...
function Geoprocessing(long, lat) {
})
Thanks, that really cleaned up the code, but I still am getting a null response from the service, I'm using a window.alert to verify the server response, could I be missing something in the DataCallBack function?
try snooping the web traffic to see the actual request and response.
So I'm not much of a web guy, how do you do that? or could you point me to some resources on it?
i meant open the developer tools in your browser and inspect the individual requests and responses.
Thanks, when I run the developer tools in chrome and place points on the page I get the following messages.
window._EsriLeafletCallbacks.c9({"error":{"code":400,"message":"Invalid URL","details":[]}});
window._EsriLeafletCallbacks.c0({"currentVersion":10.5,"serviceDescription":"","tasks":["Value Extraction Tool"],"executionType":"esriExecutionTypeSynchronous","resultMapServerName":"","maximumRecords":1000});
I'm guessing then it means that the URL to the geoprocessing service is bad, and since the URL to the service itself is fine, I'm guessing that the problem is in the constructed part of the URL that passes parameters back to the service.
there's no need to guess. inspect the url and the request parameters for a successful request when visiting the raw service endpoint and compare and contrast that with what's being sent from your esri-leaflet app.