Using FV3.1 and the latest available widgets, I am using the SwipeSpotlight widget and the Map Services widget (not the drag/drop, but this one http://www.arcgis.com/home/item.html?id=4ed10ea387444952a3f3f501fee02b76 ).I have added the following to the SwipeSpotlight.mxml: map.addEventListener(MapEvent.LAYER_ADD, mapLayerAddHandler, false); map.addEventListener(MapEvent.LAYER_REMOVE, mapLayerRemoveHandler, false); } private function mapLayerAddHandler(event:MapEvent):void { if(layArr.indexOf(event.layer.name) == -1){ layArr.push(event.layer.name); } } private function mapLayerRemoveHandler(event:MapEvent):void { if(layArr.indexOf(event.layer.name) > -1){ layArr.splice(layArr.indexOf(event.layer.name),1); } }
Now, if I add a layer using the MapServices widget and tell it to load at the bottom, it will load t the bottom of the TOC and will show in the dropdown list of the SwipeSpotlight widget. Doesn't really help much, as if it is on the bottom, I don't need to swipe it. However, if I configure to load at the top of the TOC, it will load it fine, but not show on the SwipeSpotlight dropdown unless I remove it, then add it again.So, for some reason, it does not add the "first" layer added by the MapServices widget to the SS widget dropdown. They only get added after a re-order of the list map.reorderLayer(dynLayer.id,configData.basemaps.length);
or adding/removing from the list.Any ideas what I am missing?R_