Hi Robert,
I'm getting the following errors when I try to do an export build for my flexviewer after I added the code to MapManager.mxml. Please tell me what I'm doing wrong.
Errors:
See details for more information.
Encountered errors or warnings while building project index.mxml.
MapManager.mxml: Type was not found or was not a compile-time constant: UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
Encountered errors or warnings while building project SearchWidget.mxml.
MapManager.mxml: Type was not found or was not a compile-time constant: UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
Encountered errors or warnings while building project WidgetContainerWidget.mxml.
MapManager.mxml: Type was not found or was not a compile-time constant: UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
Encountered errors or warnings while building project TOCWidget.mxml.
MapManager.mxml: Type was not found or was not a compile-time constant: UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
Encountered errors or warnings while building project MapSwitcherWidget.mxml.
MapManager.mxml: Type was not found or was not a compile-time constant: UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
Encountered errors or warnings while building project LayerListWidget.mxml.
MapManager.mxml: Type was not found or was not a compile-time constant: UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueRenderer.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
MapManager.mxml: Call to a possibly undefined method UniqueValueInfo.
Code I added to my MapManager.mxml:
case "feature":
{
var featureLayer:FeatureLayer = new FeatureLayer(url);
featureLayer.addEventListener(FlexEvent.HIDE, featureLayer_hideHandler);
featureLayer.alpha = alpha;
featureLayer.id = label;
featureLayer.name = label;
featureLayer.maxAllowableOffset = maxAllowableOffset;
featureLayer.outFields = [ '*' ]; // TODO: be smarter
featureLayer.token = token;
featureLayer.visible = visible;
featureLayer.useMapTime = useMapTime;
featureLayer.clusterer = clusterer;
if (label == "NEP_Projects")
{
var picSymbol1:PictureMarkerSymbol = new PictureMarkerSymbol("assets/images/i_camera.png",30,30,0,0,0);
var picSymbol2:PictureMarkerSymbol = new PictureMarkerSymbol("assets/images/i_target.png",30,30,0,0,0);
var uniqueValuerenderer:UniqueValueRenderer = new UniqueValueRenderer();
uniqueValuerenderer.attribute = "PHOTO";
var uniqueValueInfos:Array = [];
uniqueValueInfos.push(new UniqueValueInfo(picSymbol1, "Y"));
uniqueValueInfos.push(new UniqueValueInfo(picSymbol2, "N"));
uniqueValuerenderer.infos = uniqueValueInfos;
featureLayer.renderer = uniqueValuerenderer;
}
if (useAMF)
{
featureLayer.useAMF = (useAMF == "true");
}
if (mode)
{
featureLayer.mode = mode;
}
if (definitionExpression)
{
featureLayer.definitionExpression = definitionExpression;
}
if (proxyUrl && useProxy)
{
featureLayer.proxyURL = proxyUrl;
}
// example for hard-coding layer symbology, e.g. for pre-10.0 ArcGIS Servers
/* if (label == "Traffic Cameras") // the layer label in main configuration file
{
var picSymbol:PictureMarkerSymbol = new PictureMarkerSymbol("assets/images/i_camera.png",30,30,0,0,0);
var rend:Renderer = new SimpleRenderer(picSymbol);
featureLayer.renderer = rend;
} */
layerObject.layer = featureLayer;
featureLayer.addEventListener(LayerEvent.LOAD_ERROR, layer_loadErrorEvent);
featureLayer.addEventListener(LayerEvent.LOAD, layer_loadEvent);
map.addLayer(featureLayer);
break;
-Alison