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!

About Jeremy Monn

Jeremy Monn first arrived on Towson University's campus in 2003 as a graduate student pursuing an M.A. in Geography. Today, Jeremy continues his commitment to Towson University as a GIS Specialist for the Center for GIS within the Division of Innovation and Applied Research, and as an adjunct instructor for the Department of Geography and Environmental Planning. Both roles allow Jeremy to pursue and share his interest in map interpretation, spatial data modeling and visualization, scripting, and web mapping technologies.

Leave a Reply