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???
Solved! Go to Solution.
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.
Bill,
Here is thread with info on what I know about this scenario:
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.
Bill,
That is a good workaround. You might consider calling tech support and requesting an enhancement to the BasemapGallery.
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!
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?
Michael,
Only if you are using an ImageServer url. If you are using MapServer url then all if fine.
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?
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.
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?