public class GraphicLayerThresholding extends ArcGISDynamicMapServiceLayer { override protected function updateLayer():void { graphics.clear(); var imageParams:ImageParameters = new ImageParameters(); imageParams.height = map.height; imageParams.width = map.width; imageParams.format = 'png32'; var mapImage:MapImage = new MapImage(); this.exportMapImage(imageParams, new AsyncResponder(onResult, onFault)); } private function onFault(info:Object, token:Object = null):void { Alert.show(info.toString(), "Export Problem"); } private function onResult(mi:MapImage, token:Object = null):void { var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); var request:URLRequest = new URLRequest(mi.href); loader.load(request); } private function completeHandler(event:Event):void { var loader:Loader = Loader(event.target.loader); _image = Bitmap(loader.content); _updateGraphic(_image, _thresholdValue); } }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.