Can't load an Image Service from my arcgis Server

883
2
Jump to solution
05-18-2021 01:52 PM
MichaelKohler
Occasional Contributor II

I have an aerial image and made a tiled map service and an Image service. I use the two layers to let user zoom in really tight with the Image Service and when zoomed out, I use the tiled map service. This works for all my java script and other apps. 

When I went to add the functionality to a Runtime app, I can't get the Image Service to show. The Tiled Map Service has always worked fine in the Runtime app.

 

 

//add the city's latest aerial
                var latestAerialUri = new Uri("https:///intgis3/rest/services/Aerials/LatestAerials/MapServer");
                latestAerialLayer = new ArcGISTiledLayer(latestAerialUri);
                myMapCreate.Basemap.BaseLayers.Clear();
                myMapCreate.Basemap.ReferenceLayers.Clear();
                myMapCreate.Basemap.BaseLayers.Add(latestAerialLayer);

                //add the image service layer
                var aerialImageUri = new Uri("https://intgis3/rest/services/Aerials/LatestAerialsImg/ImageServer");
                aerialImageLayer = new ArcGISMapImageLayer(aerialImageUri);                
                myMapCreate.Basemap.BaseLayers.Add(aerialImageLayer);
              

 

 

 

the Runtime Version being used is 100.2.1.0. 

0 Kudos
1 Solution

Accepted Solutions
MichaelBranscomb
Esri Frequent Contributor

Hi,

To create a layer from an  `ImageServer` endpoint, you should use the RasterLayer and ImageServiceRaster classes.

Resources:
https://developers.arcgis.com/net/wpf/api-reference/html/T_Esri_ArcGISRuntime_Mapping_RasterLayer.ht...

https://developers.arcgis.com/net/wpf/sample-code/raster-layer-service/

 

Thanks

View solution in original post

0 Kudos
2 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

To create a layer from an  `ImageServer` endpoint, you should use the RasterLayer and ImageServiceRaster classes.

Resources:
https://developers.arcgis.com/net/wpf/api-reference/html/T_Esri_ArcGISRuntime_Mapping_RasterLayer.ht...

https://developers.arcgis.com/net/wpf/sample-code/raster-layer-service/

 

Thanks

0 Kudos
MichaelKohler
Occasional Contributor II

Thanks! This worked.

 

var aerialImageUri = new Uri("https:/*****/intgis3/rest/services/Aerials/LatestAerialsImg/ImageServer");
ImageServiceRaster misr = new ImageServiceRaster(aerialImageUri);
RasterLayer rl = new RasterLayer(misr);
myMapCreate.OperationalLayers.Add(rl);

 

0 Kudos