protected function referenceDataLayerLoadComplete(event:FlexEvent):void { // Note that referenceDataMapLayer is an ArcGISDynamicMapServiceLayer from 10.0 SP1 // we fire the event on the layer LOAD event, otherwise we end up called arcgis.com var token:AsyncToken = referenceDataMapLayer.getLegendInfos(null); var responder:mx.rpc.Responder = new mx.rpc.Responder(getLegendResult, getLegendFault); token.addResponder(responder); } public function getLegendResult(obj:Object):void { trace("We have a result"); } public function getLegendFault(obj:Object):void { trace("We have an error"); }
That being said... your suggestion inspired me to work up a new strategy for handling group layers within my application using the REST enpoint.
protected function referenceDataLayerInitComplete(event:FlexEvent):void { // Note that referenceDataMapLayer is an ArcGISDynamicMapServiceLayer from 10.0 SP1 var token:AsyncToken = referenceDataMapLayer.getLegendInfos(null); var responder:mx.rpc.Responder = new mx.rpc.Responder(getLegendResult, getLegendFault); token.addResponder(responder); } public function getLegendResult(obj:Object):void { trace("We have a result"); } public function getLegendFault(obj:Object):void { trace("We have an error"); }
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.