Select to view content in your preferred language

Unable to load result MapImageLayer time to time - JS API 4.6

1929
0
02-06-2018 12:39 PM
UdayaJayawardhana
New Contributor II

I have geoprocessing service which produces a MapImageLayer as the result. I execute the asynchronously using the JavaScript API method  "submitJob" method.

var gpTask = new Geoprocessor(gpTaskUrl);
gpTask.outSpatialReference = {
   wkid: 102100
};
gpTask.submitJob(params).then(drawResultData, errBack);‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

It GP task is executed successfully all the time, I see it when I check the server using the job ID. But the resulting map image layer is loaded only in some cases, otherwise I see an error. Specially when the layer is loaded successfully, if I zoom into a specific area there is an increase probability to see the same error.

[esri.views.2d.layers.MapImageLayerView2D] e 
{ name: "dynamiclayer:image-fetch-error", 
  message: "Unable to load image: https://arcgis.<domain>…at=png32&transparent=true&layers=show%3A0&f=image", 
  details: {}}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

The failed request is:

https://arcgis.<domain>/arcsrv/rest/services/<ResultMapServiceName>/MapServer/jobs/je13d9121d0ee4270894ebd01f66758a1/export?bbox=-14177540.562098123%2C1761435.9140478536%2C-4784958.526418162%2C6990951.641205082&bboxSR=102100&imageSR=102100&size=1920%2C1069&dpi=96&format=png32&transparent=true&layers=show%3A0&f=image‍‍

This request is made internally as a result of the map loading process.

I found another interesting thing here. If I go to the GP job using the browser and refresh it, then it starts working even in the web app. This is the way I check the job inside the server.

https://arcgis.<domain>/arcsrv/rest/services/<GPServiceName>/GPServer/<GPTaskName>/jobs/je13d9121d0ee4270894ebd01f66758a1‍‍

I have already checked the timeout/clean up rules applicable in this GP scenario, it seems they have no impact in this case. I use JS API 4.6, appreciate any help here. 

0 Kudos
0 Replies