Designing a map to overlay ArcGIS Online in a Web application
In November 2006, ESRI announced the public beta release of ArcGIS Online, a set of base map and reference services available for ArcGIS users. These services include imagery, street maps, elevation data, and more. For ArcGIS Desktop users, overlaying your own data on top of ArcGIS Online is as easy as clicking the Add Data button.
But how do ArcGIS Server users overlay their data with ArcGIS Online in a Web application? It’s straightforward to add multiple services to a Web application in Manager or Visual Studio. Remember, though, that ArcGIS Online services are cached, so when using them with your map services, you’ll need to make considerations on how your map services are prepared and cached.
In this post, we’ll talk about some of the steps required for building a cached map service that you can overlay with ArcGIS Online. Note that Version 9.2, Service Pack 2 of the Web ADF included enhancements for overlaying multiple cached maps in a Web application, so before attempting these steps, you’ll need to get Service Pack 2 or greater.
Overlaying map caches in the Web ADF is all about choice of scales. For best performance, the scales from all of your map caches should match so that the original tiles can be used for each layer. Suppose you’re overlaying Cache A, which has 14 scales, with cache B, which covers a smaller area. You don’t have to build Cache B at all 14 scales, but you should make sure that the scales you do use for Cache B match a sequential subset of the scales used in Cache A.
What scales are used in ArcGIS Online?
The ArcGIS Online caches use a set of precise scales that have been carefully devised for two purposes:
- Match the scale-change thresholds built into ESRI globe clients The globe caches on ArcGIS Online were originally made from the 2D caches draped over the globe (To learn how you can use this technique, see the previous post Creating a 3D globe cache from a 2D map cache.). Unlike 2D caches for which you can pick your scales, ESRI 3D clients have built-in levels at which globe cache tiles take effect. If you use the scales in ArcGIS Online for your 2D caches, you can depend on your original rendering for each scale level appearing in ArcGIS Explorer and ArcGlobe if you ever use your service to create a 3D cache.
- Match edges at 180 degrees longitude when used on a globe Because the 2D caches are used to make the 3D caches, the scale levels used must be engineered to avoid overlap at the "edge" of the globe at 180 degrees longitude.
The scales (or technically, "scale factors") used by ArcGIS Online are as follows:
- 147748799.285417
- 73874399.6427087
- 36937199.8213544
- 18468599.9106772
- 9234299.95533859
- 4617149.97766929
- 2308574.98883465
- 1154287.49441732
- 577143.747208662
- 288571.873604331
- 144285.936802165
- 72142.9684010827
- 36071.4842005414
- 18035.7421002707
- 9017.87105013534
- 4508.93552506767
Remember, you only need to use these precise values when building the cache in ArcGIS Server. When designing your map in ArcMap, you can use these scales without worrying about the values beyond the decimal point. To learn how to load this list of scales into ArcMap's dropdown list, see the post Viewing cached map services (such as ArcGIS Online) in ArcMap.
Designing your map
How did ESRI design the maps that are available in ArcGIS Online, for example, the World Street Map? The cartographers in charge of this project first determined the scales at which the map would be cached, then chose layers and symbology appropriate for each of those scales. You’ll do a similar thing when building your map service that will overlay ArcGIS Online.
This is an easier process when working with raster imagery. You’ll notice that the ArcGIS Online satellite and aerial imagery services only include two or three different resolution raster images, and no extra symbology changes are needed before caching these at numerous scale levels. However, when using vector features, you may need to make subtle symbology changes at each scale in order to keep your layers from cluttering the map, or to keep the map from looking too sparse. Since you’re more likely to be putting your vector data on top of ArcGIS Online raster layers, instead of vice versa, we’ll focus on what it takes to prepare vector data for caching and overlay.
Here’s a suggested workflow for preparing vector layers for a map service that will overlay ArcGIS Online:
-
First, do some planning by making a list all of the layers that will be visible in your map. Include all layers, whether they will be visible at all scales or not. Leave some space in between each layer name.
-
For each layer, list the ArcGIS Online scales at which the layer will be visible. For example:
Parks
"577143.74..."
"288571.87..."
"144285.93..."
"72142.96..."
Fire stations
"144285.93..."
"72142.96..."
etc.
-
Create a new map document and set the data frame coordinate system to GCS_WGS_84. Currently, you must use this coordinate system for any map that you intend to overlay with ArcGIS Online. In the future, ArcGIS Online intends to provide maps in additional coordinate systems.
-
Add each layer to your map n number of times, n being the number of scale levels at which the layer will be visible. (You may find that copying and pasting the layers back into the table of contents is faster than using the Add Data button for this purpose.) You can keep the default symbology of all layers for now.
-
In the table of contents, give each instance of the layer the name of one of the scales you chose and set a scale range on the layer that encompasses that scale. For example, name one of the layers Parks 1:72k and set a scale range of 1:50,000 to 1:100,000. Name another layer Parks 1:144k and set a scale range of 1:100,000 to 1:200,000. Be sure that the scale dependency thresholds you choose do not overlap the next highest or lowest ArcGIS Online scale (for example, you would probably not want to set a scale range of 1:100,000 to 1:300,000 because that encompasses two ArcGIS Online scales: 288571.873604331 and 144285.936802165).
-
Now create a group layer that includes all scales for a layer. For example, take the layers Parks 1:72k, Parks 1:144k, Parks 1:288k, and Parks 1:577k and make a group layer out of those called Parks. The image below shows an ArcGIS Online source map document that has been organized in a similar way for roads and place names. Note the group layers in the table of contents.
-
Set the appropriate symbologies for all layers at all scales. A good strategy is to start at the smallest (farthest out) scale, set symbology for all layers, and then work inward by scale level, setting the symbology for all layers at that level before moving in to the next scale. This is where loading the custom scales into the ArcMap dropdown, as mentioned earlier, can be useful.
-
When you are satisfied with the appearance of your map document at all scales, publish it as an ArcGIS Server map service.
-
Create the map cache, using all or a sequential subset of the precise ArcGIS Online scales specified above. For the tile origin, use -180, 90. For the tile size, use 512 X 512. For image format, it’s recommended that you use PNG8. You should not use JPG if you will put the cache on top of any other layer, since JPG does not support transparency. Also, if you choose PNG24, Internet Explorer 6 users may not be able to see the transparency correctly due to a limitation in the browser.
Additional help for creating the cache:
-
Add the cached map service and an ArcGIS Online service to a Web Mapping Application.
Note: Manager gives an option for you to select which service will provide the coordinate system and extent for the map. In this scenario, you can choose either the ArcGIS Online service, or the one you just cached, depending on the initial extent you want. Do not select any other services that your map may contain.
Example:
Here's an example of a map that overlays ArcGIS Online. In this example, I created a map of USGS topographic map boundaries and names that is designed to overlay the NGS_Topo_US_2D service from ArcGIS Online. The boundaries are for three available series of USGS maps, including the 7.5 minute quadrangles. You'll need to zoom in from the initial extent in order to see the boundaries.

The boundaries map is cached at the following scale levels:
- 4617149.97766929
- 2308574.98883465
- 1154287.49441732
- 577143.747208662
- 288571.873604331
- 144285.936802165
Notice how the symbology of the boxes and the annotation changes as you zoom between scale levels. This example requires some flexibility with the procedure listed above because some of the layers use the same symbology for multiple scale levels. Also, some of the layers are designed to overlap at certain scales. For example, the solid dark lines overlay the dashed green lines at a few scales.
It’s possible that your map projects will require similar adjustments. Detailed planning using drawings, tables, and other visual aids, if necessary, can help you set the proper scale dependencies and symbology for each layer. Careful testing, as well as some trial and error, will also help you ensure that your map looks appropriate at all scales. It’s worth the extra effort to make sure the map is correct before creating the cache, especially if the cache will include many scale levels.
-Sterling Quinn