A couple weeks ago I was asked to troubleshoot the odd behavior of a cached map service in a FLEX web mapping application. The application provides users with the ability to view the map at 11 different scales ranging from approximately 1:2300000 to approximately 1:2250. The FLEX web mapping application uses several cached map services, but one disappeared when a user zoomed into the largest scale possible (1:2250). This behavior was very odd because the cached tiles existed for the map service at the largest scale (1:2550). So what was causing the odd behavior?
After comparing the cached services used in the application, I noticed that the cache level scales were all EXACTLY the same except for the largest scale. (Up to this point I have referred to the largest scale as “approximately 1:2500”. The true value for the largest scale is actually 1:2254.4677625.) The cached map service that did not display correctly at the largest scale had its largest scale set to 1:2254.467763 not 1:2254.4677625. In order for the service to display correctly in the application at the largest scale, I had to replace the cache tiles tied to the incorrect scale (1:2254.467763) with cache tiles created at the correct scale (1:2254.4677625). So how did I do this?
Most GIS Specialists familiar with creating AGS map service caches would automatically think the solution is to simply delete the old cache level using ArcCatalog and add the new one. Unfortunately this doesn’t always work. When I tried this method, I noticed that even though I entered the correct scale (1:2254.4677625), the scale was rounded off to the wrong scale (1:2254.467763) once I applied the changes. The workaround I used to solve the problem involved editing the service’s configuration file using Notepad ++. The steps I used are provided below:
1) Open Windows Explorer
2) Navigate to the location of the map service’s cache folder
3) Locate the map service’s cache XML configuration file
4) Open the configuration file with a text editor (e.g. Notepad ++)
5) Manually correct the appropriate scale and save the configuration file
6) Open ArcCatalog, refresh the map service, and re-create the cache tiles for the corrected scale
Hopefully you found this helpful, I also published a blog post a while back on Lessons Learned: Creating a KML-Enabled ArcGIS Server Map Service that might be of use!