Integrating Larger Scale maps in ArcGIS Viewer for Flex
While conducting Community Maps client workshops over the past year I’ve had one particular reoccurring question from clients which seemed like a good topic to bring up in a Blog.
”How can we build and consume larger scale basemaps than the ArcGIS Online World Topographic Service in our Web-Applications (larger than 1:1,000)?”
First a brief review on the current ArcGIS Online (cached map) scales. The current World Topographic map service for ArcGIS Online follows an industry standard tiling scheme (Google Maps and Bing) which dictates the zoom levels and coordinate system used for the cache tiles. The tiling scheme used for ArcGIS Online and Google Maps/Bing ranges from zoom levels (0-19) or map scales 1:591 Million to 1:1,000. See the illustration below for more detail or visit the Planning Map Cache online help here.
ArcGIS Online levels and scales
This means that the largest scale that can be cached in the World Topographic Service is 1:1,000. However, this does not necessarily mean that a web application couldn’t consume other map services hosted by a client with larger scales cached in a similar tiling scheme!
I recently met with Derek Law, the Esri Product Manager of the ArcGIS Viewer for Flex to discuss this very matter. He was intrigued to hear this user request and stepped in to provide the following instructions for integrating multiple map services in the ArcGIS Viewer for Flex.
Instructions for implementing two (2) map services with different cache scales in the ArcGIS Viewer for Flex
The ArcGIS Viewer for Flex is a released ready-to-deploy viewer application. It is configurable, so you can easily add tools and data content without programming. You can also extend its functionality with custom widgets available from the Esri community, or create custom widgets yourself with the ArcGIS API for Flex. To get started, the viewer can be downloaded at this link.
The Viewer’s map scale level is determined by the first basemap layer that is loaded into it; this is the first layer that is specified in the application configuration file (e.g., config.xml) with a <layer> tag. Subsequent layers that are added to the viewer will confirm to the map scale level set by the first basemap layer.
In some instances, you may want to include more levels of detail (LOD), for additional map services that contain more detailed information than the first basemap loaded into the Viewer. These LODs would be at a finer (i.e., greater) resolution than the highest map scale set by the first basemap. This capability can be enabled by editing the Viewer’s application configuration file.
map service 1 (Hosted on ArcGIS Online) – City level data, cached map service (1:1,000 to 1:9,000 scale levels)
map service 2 (Hosted by Client) – City Block level data, cached map service (1:500 to 1:250 scale levels)
By default, the Viewer’s application configuration file (config.xml) would look something like this:
<map initialextent=”-14083000 3139000 -10879000 5458000″ top=”40″>
<layer label=”Streets” type=”tiled” visible=”true” url=”http://server.arcgisonline.com/ArcGIS/rest/services/map service 1″/>
In which case, the Viewer’s map scale level would be set from 1:1000 to 1:9000 scale levels. Now, if you wanted to include more LODs by adding map service 2, you would use the <lods> tag, like so:
<map initialextent “-20037507.067168 -20037507.0671618 20037507.0671618 20037507.0671619″ top=”40″>
<layer label=”Streets” type=”tiled” visible=”true” url=”http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer” displaylevels=”8,9,10″ />
<lods><!– show levels that you want to see on Navigation Slider–>
<lod resolution=0.0439453125" scale="18468599.9106772"/>
<lod resolution=”0.02197265625″ scale=”9234299.95533859″/>
<lod resolution=”0.010986328125″ scale=”4617149.97766929″/>
The resolution and scale attributes of the <lods> tag can be determined from the REST Endpoint:
Open this link in browser:
Copy paste levels of display from:
- Levels of Detail: (# Levels: 9)
View from REST Endpoint for Levels of Detail
For more information on the ArcGIS Viewer for Flex or other web API’s be sure to check out the Web Resource Center at the following link for further information. http://resources.arcgis.com/content/web/about
Written by: Seth Sarakaitis