AnsweredAssumed Answered

Can't add GPResultImagelayer to map

Question asked by janne58 on Aug 6, 2015
Latest reply on Sep 13, 2015 by janne58

I have created an GPK package that results in a raster. I'm using SubmitJob to run it and GPResultImagelayer to add the geoprocessing result to the map. But it fails at map.Layers.Add(gpResultLayer) with the error shown in attached picture.

When testing gpResultLayer.ServiceUri in a browser, I can fetch the tif-image and it looks okey.

This is a bit of the code, a little simplified:

if (result.JobStatus == GPJobStatus.Succeeded)

{

     var gpResultLayer = await _gpTask.GetResultImageLayerAsync(result.JobID, "outraster") as GPResultImageLayer;

     await gpResultLayer.InitializeAsync();

     if (gpResultLayer.Status == Esri.ArcGISRuntime.Layers.LayerStatus.Initialized)

     {

               gpResultLayer.Opacity = 0.5;

               gpResultLayer.ID = "raster";

               map.Layers.Add(gpResultLayer);

     }

}

 

What can be the reason for this problem?

I'm not sure if I provided information enough, but I give it a try.

 

Attachments

Outcomes