<esri:ArcGISDynamicMapServiceLayer id="sidewalkMapServer" name=" " visible="false" url="http://......DOE_Sidewalk/MapServer"/> <esri:FeatureLayer id="sidewalkComments" mode="snapshot" visible="false" url="http://......SidewalkComment/FeatureServer/0"/>
public function sintBox(evt:MouseEvent):void { sidewalkMapServer.visible = true; if(CheckBox(evt.target).selected) { } else { sidewalkMapServer.visible = false; } } public function scomBox(evt:MouseEvent):void { sidewalkComments.visible = true; if(CheckBox(evt.target).selected) { } else { sidewalkComments.visible = false; }
Solved! Go to Solution.
<esri:ArcGISDynamicMapServiceLayer id="opsMapServer"
name=" "
visible="{opsCheckBox.selected}"
url="http://........../>
<s:CheckBox id="opsCheckBox"
label="Watershed Enhancement"
fontSize="14"
selected="false"
click="CheckBox_clickHandler(event)"/>
protected function CheckBox_clickHandler(event:MouseEvent):void
{
myMap.zoom(1);
}
<mx:ViewStack id="myViewStack" width="330" height="72" creationPolicy="all">
public function loadLayerName():void { radioSelect.removeAllChildren(); //myLayerId = null; //loop through each layer and add as a radiobutton for(var i:uint = 0; i < (statsLayer.layerInfos.length); i++) { var radioBtn:RadioButton = new RadioButton; radioBtn.groupName = "radioBtnGroup"; radioBtn.value = i; radioBtn.label = statsLayer.layerInfos.name; radioSelect.addChild(radioBtn); } //set the visible layer the first radio button radioBtnGroup.selectedValue = null; statsLayer.visibleLayers = new ArrayCollection(); //refresh the legend map1StatsLegend.layers = [statsLayer, contextLayer]; map1StatsLegend.map = Map1; //myLayerId += radioBtnGroup.selectedValue; }
<esri:Legend id ="map1StatsLegend" x= "470" y = "57" respectCurrentMapScale="true"/>