Is it difficult to use scale dependancy to switch between Street_Map, Imagery, and topo's in the new Flex Viewer 2.3.1? I would like to leave StreetMap visible on initial extent w/option of switching to topo's but automatically go to aerial imagery when zoomed in beyond visible extent of StreetMap or topo. I know in previous versions of the viewer this was handled in the MapManager.mxml code using the following:
private function checkScale(evt:Event):void
{
var tl:ArcGISTiledMapServiceLayer;
//If ESRI Street maps <9000 Turn off ESRI Street map and switch to imagery.
if(map.scale < 9000)
{
tl = map.getLayer("Street Map") as ArcGISTiledMapServiceLayer;
tl.visible = false;
tl = map.getLayer("Satellite Map") as ArcGISTiledMapServiceLayer;
tl.visible = true;
}
if(map.scale > 9000)
{
tl = map.getLayer("Street Map") as ArcGISTiledMapServiceLayer;
tl.visible = true;
tl = map.getLayer("Satellite Map") as ArcGISTiledMapServiceLayer;
tl.visible = false;
}
}