Image Serivce not showing with ios sdk beta 3 but it does with 10.2.5

1314
7
10-29-2016 07:25 AM
RamiBader1
New Contributor II

The ImageSerivce not showing with ios SDK Beta 3 Quartz, like this:

//create a map image layer using a url

let mapImageLayer = AGSArcGISMapImageLayer(URL: NSURL(string:"my url/

ImageServer")!)

//initialize the map

self.map = AGSMap()

//add the image layer to the map

self.map.operationalLayers.addObject(mapImageLayer)

self.mapView.map = self.map

But it woks like this with version 10.2.5 ios SDK.

let mapImageLayer = NSURL(string: "my url/ImageServer")

let layer = AGSImageServiceLayer(url: mapImageLayer as URL!)

self.mapView.addMapLayer(layer)

Is there a bug in ios SDK Beta 3 Quartz or what? any ideas?

ios sdk‌ beta3 

/Rami 

Tags (2)
0 Kudos
7 Replies
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Rami,

I think the issue is you need to load the ImageServer depend on whether it is a tiled or dynamic layer. For more information, please check our Quartz documentation talks about layer:

Layers—ArcGIS Runtime SDK for iOS (Quartz Beta) | ArcGIS for Developers 

Map services from ArcGIS for Server fall into two broad categories: tiled and dynamic. Tiled services provide pre-generated (cached) tiles based on the tiling scheme of the layer. Tiles may be provided as raster image tiles or as vector data tiles. The layer then assembles these tiles in the client app. You can access a tiled map service using a tiled layer. Dynamic map services, however, provide map images created on the fly as requested by the client. You can access dynamic map services using a map image layer.

Based on this, here I shared with you a snippet code and it works fine to load the "tiled" Image service on Quartz iOS SDK:

imageLayer = AGSArcGISTiledLayer(URL: NSURL(string: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer")!)
    self.map = AGSMap()
    self.map.operationalLayers.addObject(self.imageLayer)
    self.mapView.map = self.map
        
    self.imageLayer.loadWithCompletion { (error) -> Void in
       if let error = error {
          print(error)
        } else {
          print(self.imageLayer.loadStatus.rawValue)
            }
        }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Hope this can help.

0 Kudos
RamiBader1
New Contributor II

Thanks Yue, I have a dynamic image service and I used this code in Quartz beta but it does not work like this.

let mapImageLayer = AGSArcGISMapImageLayer(URL: NSURL(string:"my url/

ImageServer")!)

self.map.operationalLayers.addObject(mapImageLayer)

If I have a dynamic image service what is the class that should i used instead of AGSArcGISMapImageLayer?

/Rami

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Rami,

Thanks for your update. After I tested with a dynamic ImageServer and I can reproduce the issue.

When using the AGSArcGISMapImageLayer to load a dynamic ImageServer, we can't see the layer renderer on the map view.

Using Fiddler to capture the request, we found this 400 error request:

http://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/export?bbox...

The reason failed is because on REST, the ImageServer exportImage request format should look like this:

http://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?

however, current Quartz API doesn't setup a condition with ImageServer, it seems always using MapServer's export request: https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/export?

I have already on your behalf logged this bug through our Beta community, please feel free to check from this url: AGSArcGISMapImageLayer exportImage requests not setup correctly for dynamic ImageServer  

Thanks for your reporting.

RamiBader1
New Contributor II

Hi Yue,

Do you know when they can fix this bug? just let me know.

/Rami

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Rami,

This is the bug that logged internally [BUG-000100541 AGSArcGISMapImageLayer exportImage request not correct for ImageServer]

At this moment, I am not sure when our dev team going to fix this issue. But this issue has been reported.

0 Kudos
RamiBader1
New Contributor II

I can not understand how you can make an official new release with this fatal bug and you know that before? the new version of SDK ios 100.0 not working with Image server, really strange?

what should we do now, what is the goal of new release if doesnt working, do you think we dare to migrate to ios 100.0?

/Rami

0 Kudos
DiveshGoyal
Esri Regular Contributor

Rami,

This is not a bug. AGSArcGISMapImageLayer does not support Image Services. It only supports dynamic Map Services. We do plan to add support for Image Services in a future release, but it didn't unfortunately make it into version 100.0 

For more information about functional parity between 10.2.5 and 100.0, you can refer to Choosing the right version | ArcGIS for Developers 

0 Kudos