case "feature": { var featureLayer:FeatureLayer = new FeatureLayer(url); featureLayer.addEventListener(FlexEvent.HIDE, featureLayer_hideHandler); featureLayer.alpha = alpha; featureLayer.id = label; featureLayer.name = label; featureLayer.outFields = [ '*' ]; // TODO: be smarter featureLayer.token = token; featureLayer.visible = visible; featureLayer.useMapTime = useMapTime; if (label == "Traffic Cameras") { var picSymbol:PictureMarkerSymbol = new PictureMarkerSymbol("assets/images/i_camera.png",30,30,0,0,0); var rend:Renderer = new SimpleRenderer(picSymbol); featureLayer.renderer = rend; } if (label == "Louisville Police Facilities") { var picSymbol0:PictureMarkerSymbol = new PictureMarkerSymbol("assets/images/i_policestation.png",30,30,0,0,0); var rend0:Renderer = new SimpleRenderer(picSymbol0); featureLayer.renderer = rend0; } if (label == "Louisville Places") { var picSymbol2:PictureMarkerSymbol = new PictureMarkerSymbol("assets/images/bat.png",30,30,0,0,0); var picSymbol3:PictureMarkerSymbol = new PictureMarkerSymbol("assets/images/horse.png",30,30,0,0,0); var picSymbol4:PictureMarkerSymbol = new PictureMarkerSymbol("assets/images/mansion.png",30,30,0,0,0); var uniqueValuerenderer:UniqueValueRenderer = new UniqueValueRenderer(); uniqueValuerenderer.attribute = "NAME"; var uniqueValueInfos:Array = []; uniqueValueInfos.push(new UniqueValueInfo(picSymbol3, "Chuchhill Downs")); uniqueValueInfos.push(new UniqueValueInfo(picSymbol2, "louisville slugger factory")); uniqueValueInfos.push(new UniqueValueInfo(picSymbol4, "Whitehall Mansion")); 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; } layerObject.layer = featureLayer; map.addLayer(featureLayer); break; }
Brian, There is a way for you to handle the symbology of the feature layer in the Flex Viewer MapManager.mxml if you are one of those that has access to Flash Builder. Let me know if you want to go down that route.
<layer label="Forecast Storm Position" type="feature" visible="true" alpha="1.0" mode="snapshot" url="http://ags.pdc.org/rest/services/GHIN/PDC_Active_Hazards/MapServer/10" useamf="false"/>
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.