1118: Implicit coercion of a value with static type mx.collections:IList to a possibly unrelated type mx.collections:ArrayCollection.
public function showLayer(layerInfo:LayerInfo):void { var visibleLayers:ArrayCollection; if (layer is ArcGISDynamicMapServiceLayer) { visibleLayers = ArcGISDynamicMapServiceLayer(layer).visibleLayers; visibleLayers.addItem(layerInfo.layerId); // add id }
ArcGISDynamicMapServiceLayer(layer).visibleLayers;
private function buildVisibleLayers(value:Array):ArrayCollection { var ac:ArrayCollection = new ArrayCollection(); var li:LayerInfo for each( li in value){ if(li.defaultVisibility) ac.addItem(li.layerId); } return ac; }
if(!ArcGISDynamicMapServiceLayer(layer).visibleLayers){ visibleLayers = buildVisibleLayers(ArcGISDynamicMapServiceLayer(layer).layerInfos); }else{ visibleLayers = ArcGISDynamicMapServiceLayer(layer).visibleLayers as ArrayCollection; }
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.