<esri:FeatureLayer id="fLayer" definitionExpression="STATE_NAME='North Carolina'"
mode="snapshot"
outFields="[MALES,FEMALES,NAME,MED_AGE,CNTY_FIPS]" symbol="{countySymbol}"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3"/>
I would like to add a feature layer to the flex viewer so that I can see the layer with a highlighted color. It is not a widget, basically just adding a layer, a feature layer. For example,<esri:FeatureLayer id="fLayer" definitionExpression="STATE_NAME='North Carolina'" mode="snapshot" outFields="[MALES,FEMALES,NAME,MED_AGE,CNTY_FIPS]" symbol="{countySymbol}" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3"/>
I put this code in the index.mxml, tried inserting the code inside the <viewer:ViewerContainer> or outside of it, but it never show up on the map. Should I go to config.xml, but how to add a feature layer in config file? Million thanks!
var myFL:FeatureLayer = new FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3");
myFL.definitionExpression = "STATE_NAME='North Carolina'";
myFL.mode = "snapshot";
myFL.outFields= [MALES,FEMALES,NAME,MED_AGE,CNTY_FIPS];
myFL.symbol = countySymbol;
map.addLayer(myFL);
Thanks a lot! It seems I can not change layer's background or outline, the only way to change that is when I creating map server?