Overlaying map caches in the .NET Web ADF
When you create any cache that will be overlaid with another cache in the .NET Web ADF, the following items require attention:
Coordinate system of your map
You will achieve the fastest performance when your cached maps are in the same coordinate system. If you use different coordinate systems, only the cache of the primary map resource (see below) is used, and the server generates a dynamic image for all other services in the map, thereby forfeiting the performance benefit of those caches.
Scale levels
You will achieve the performance benefit of both caches only when the two caches have matching scale levels. In the case of a scale-level gap (when a scale level exists in one cache but not another), the overlaying image cannot be pulled from the cache and must be generated dynamically, thereby slowing performance. Image quality will also be degraded in this scenario, because the dynamic image must be resampled from one of the existing scale levels.
In the diagram below, Cache A does not exist at Scale 3; therefore, the .NET Web ADF will generate a dynamic image to overlay the image from Cache B at this scale.
Dynamic images are not created to match scales beyond the top or bottom scale of the cache. Therefore, for Cache A, a dynamic image will not be generated at Scale 5. Instead, Cache A will not be visible at Scale 5; only the cached image from Cache B will be displayed. Similarly, at Scale 1, only Cache A will be visible.
Image format
When choosing an image format for your caches that will be viewed in the .NET Web ADF, keep in mind the following points:
- Although the JPEG image format tends to display the fastest, it does not support transparency. Therefore, only use the JPEG image format for a cache when you are certain that it will always be the bottom layer in the map.
- PNG 24-based caches do not show transparency in Internet Explorer 6. (See the related Microsoft technical article at http://support.microsoft.com/kb/294714.) If you use a PNG 24-based cache on top of another cache, the .NET Web ADF automatically converts the top PNG 24 image to a PNG 32, potentially slowing performance. A faster solution is to create the overlaying cache in PNG 32 format.
Setting the primary map resource in your Web application
In .NET Web applications containing more than one map service, the primary map resource determines which service will supply the coordinate system and zoom levels of the map. When you build a Web application in Manager, note the Use coordinate system and extent of drop-down list. The service you choose here becomes the primary map resource. If you use Visual Studio to build your Web applications, the primary map resource is a property of the Map control. Follow these guidelines for setting the primary map resource:
- If you are overlaying multiple cached services with the same coordinate system and matching scales (as described above), choose either cached service as the primary map resource. In this scenario, the Zoom Level control will include the scale levels from all cached services.
- If you are overlaying multiple cached services with different coordinate systems or scales, choose as the primary map resource the service whose coordinate system you want used in the map. The Zoom Level control will only include the scale levels from this service. Images from the other service will be drawn dynamically to match the coordinate system and scales of the primary map resource. In other words, the cache from the non-primary map resource will not be used.
- If you are overlaying a cached service with a noncached service, you should generally choose the cached service as the primary map resource. The only exception to this would occur if you want the coordinate system of your noncached service to be used in the map and you are willing to sacrifice the performance benefit of the cache.