Skip To Content

Add LODs for extra zooming

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx=""
               pageTitle="Adding LODs to provide more zoom levels">
    This example demonstrates how to use a tiled basemap at certain levels,
    but when zoomed in use a dynamic service.

    For more information, see the API documentation.

            import com.esri.ags.layers.supportClasses.LOD;

            private function addLODs():void
                // make sure the resolution makes sense for tile schema of the base layer
                // both resolution and scale are required fields
                // About NaN: The lods are automatically sorted based on scale, so setting level isn't necessary.
                var lods:Array = myMap.lods;
                lods.push(new LOD(NaN, 0.6, 3000));
                lods.push(new LOD(NaN, 0.3, 1500));
                lods.push(new LOD(NaN, 0.1, 500));
                myMap.lods = lods;

        <s:RichText width="100%">
            Zoom in past 1:4,500 and you'll notice the basemap switching.
            When zoomed out, ArcGIS Online Street Map is used, but when zoomed in a dynamic service for Louisville, KY will display parcels, landuse, and planning.

    <esri:Map id="myMap" load="addLODs()">
            <esri:Extent xmin="-9551990" ymin="4617767" xmax="-9550520" ymax="4618606">
                <esri:SpatialReference wkid="102100"/>
                <!-- same as tiled map service below -->
        <esri:ArcGISTiledMapServiceLayer maxScale="4500" url=""/>
        <esri:ArcGISDynamicMapServiceLayer minScale="4500" url=""/>