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"); }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.