Cached Image Service behaving dynamically in basemap gallery

2901
14
Jump to solution
03-23-2016 03:22 PM
BillDaigle
Occasional Contributor III

I am attempting to load a cached Image Service into a basemap gallery.  The image service does work, but it is behaving like a dynamic image service, not a cached one.  By that, I mean that it is running a export image request each time the map pans instead of fetching the pregenerated tiles.

Here is a link to the service: https://gisservicemt.gov/arcgis/rest/services/MSL/Reference100k_cached/ImageServer

Here is the link to a jsFiddle demonstrating a basemap gallery with one tiled map service and one tiled image service.

https://jsfiddle.net/bdaigle/22Lgp45f/

If you watch the network traffic, you will see that the two basemaps handle the request very differently -- the tiled map service fetches map tiles, whereas the tile image service runs an exportImage task.

The service does behave like a cached service if I explicitly define it as a ArcGISTiledMapServiceLayer and load it to the map manually (without the use of the Basemap Gallery), so I believe this is an issue with the BasemapGallery itself.

I have a couple of ideas for work arounds, but thought I would check with the community before going down that road.

Any ideas???

0 Kudos
1 Solution

Accepted Solutions
BillDaigle
Occasional Contributor III

Thanks for the link Robert.  I took a look at the AMD code for the BasemapGallery.  It looks like there is no hope for the service getting loaded to the basemap gallery as a tiled layer unless the service has a 'mapName' property.  Unfortunately, Image service don't have this property.  Instead, they have a 'name' property.

Here is a potential workaround that I have been "fiddling" with.  Essentially, it involves loading the Cached image service as a standard ArcGISTiledMapServiceLayer, then using the basemapGallery's selection-change event to add or remove it from the map.

https://jsfiddle.net/bdaigle/22Lgp45f/8/

View solution in original post

14 Replies
RobertScheitlin__GISP
MVP Emeritus

Bill,

  Here is thread with info on what I know about this scenario:

https://community.esri.com/thread/172414#comment-588467

BillDaigle
Occasional Contributor III

Thanks for the link Robert.  I took a look at the AMD code for the BasemapGallery.  It looks like there is no hope for the service getting loaded to the basemap gallery as a tiled layer unless the service has a 'mapName' property.  Unfortunately, Image service don't have this property.  Instead, they have a 'name' property.

Here is a potential workaround that I have been "fiddling" with.  Essentially, it involves loading the Cached image service as a standard ArcGISTiledMapServiceLayer, then using the basemapGallery's selection-change event to add or remove it from the map.

https://jsfiddle.net/bdaigle/22Lgp45f/8/

RobertScheitlin__GISP
MVP Emeritus

Bill,

  That is a good workaround. You might consider calling tech support and requesting an enhancement to the BasemapGallery.

0 Kudos
BillDaigle
Occasional Contributor III

Robert,

I did end up submitting a ticket with tech support.  They referred me to [BUG-000093062: The Basemap Gallery widget sends an export request instead of requesting for tiles when used with a cached image service.], which has been closed as known limitation.

I couldn't seem to the track down the bug.  Probably because it has already been closed.  Since I have another workaround, I dropped the issue.  Best to pick your battles wisely!

0 Kudos
MichaelVolz
Esteemed Contributor

So caching an image service to get better service performance and using it in the BaseMap Gallery is really pointless as ArcGIS Server is just serving it out as an image service anyway?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Michael,

Only if you are using an ImageServer url. If you are using MapServer url then all if fine.

0 Kudos
MichaelVolz
Esteemed Contributor

Robert:

I have an image service that I cached, but the cached image service still appears with an ImageServer url.  In order to obtain a MapServer url would I need to add this image service to an mxd and then cache the mapservice created from the mxd?

Would this not be considered a cascading mapservice (as it contains an image service) that ESRI says is not good practice?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Michael,

  If you are using Image Server than you will not be able to get the advantages of the basemap gallery using the cached image service. But if you are using a normal map server service than the basemap gallery will use the cache.

So caching an image service to get better service performance and using it in the BaseMap Gallery is really pointless as ArcGIS Server is just serving it out as an image service anyway

So yes, caching an Image Server service is pointless.

0 Kudos
MichaelVolz
Esteemed Contributor

Bill:

Can you provide a screenshot of the difference between the tiled map service fetches and the tile image service that uses an exportImage task?  Are you looking at this in the Network tab of F12 Developer Tools in Google Chrome?

0 Kudos