Original User: odoeHas anyone found a clean way to dynamically switch the Nav from LODS to dynamic and back?
protected static const SCALE:Number = 1128.497176;
protected var lods:Array;
protected function onMapExtentChange_handler(event:ExtentEvent):void {
trace(map.scale);
trace(map.level);
if (map.level == 19) {
lods = map.lods;
map.lods = null; // tried map.lods = [], get same error
map.scale = SCALE; // tried setting scale manually here
trace(map.scale);
}
else if (map.level < 0 && map.scale >= SCALE) {
map.lods = lods;
}
}
I get the same null object error.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.esri.ags.components::Navigation/map_extentChangeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at com.esri.ags::Map/tweenEndHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at MoveResize/enterFrameHandler()
Basically, I have a need to turn on a dynamic layer of detailed imagery when the user hits the maximum zoom level and zoom in further, then turn the LOD's back on when the user hits the scale equal to the Tiled layers maximum zoom level and turn the detailed imagery off. I don't want to add LOD's.Has anyone come up with a clean solution to this?man, that map_extentChangeHandler() seems to be a private function. Trying esri_internal to see if I can trick it, but no go.