FeatureLayer Legend widget issue

660
3
Jump to solution
08-15-2013 03:04 PM
TerryGiles
Occasional Contributor III
I have a featurelayer in my map which contains polygons with an outline but no fill.  It displays in the map correctly, but in the legend widget, it shows up with a black fill (under 'UpperColorado' in the 1st image below).  If I look at the legend for the map service's REST endpoint, the symbol looks correct (2nd image).
Any idea how to fix this?

Thanks, TG
[ATTACH=CONFIG]26734[/ATTACH]
[ATTACH=CONFIG]26735[/ATTACH]
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: uppudada

var layer = new esri.layers.FeatureLayer("http://servername:6080/arcgis/rest/services/test/test_Dis/MapServer/1", {
mode : esri.layers.FeatureLayer.MODE_SNAPSHOT,
opacity: 1.0,
outFields : ["*"]
});

You can use opacity: 1.0 for not displaying fill color in legend....


Thanks
Upendra

View solution in original post

0 Kudos
3 Replies
JasonZou
Occasional Contributor III
Interesting result. Unfortunately, I don't think there is something you can do with the legend dijit result. I would try two alternatives:
1. Use agsjs.dijit.TOC developed by nliu. (http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109)
2. It's not too hard to develop a custom one using REST API, especially if you only want to display the legend, not to have it also works as Table of Content.
0 Kudos
by Anonymous User
Not applicable
Original User: uppudada

var layer = new esri.layers.FeatureLayer("http://servername:6080/arcgis/rest/services/test/test_Dis/MapServer/1", {
mode : esri.layers.FeatureLayer.MODE_SNAPSHOT,
opacity: 1.0,
outFields : ["*"]
});

You can use opacity: 1.0 for not displaying fill color in legend....


Thanks
Upendra
0 Kudos
TerryGiles
Occasional Contributor III
Thank you Upendra, explicitly setting the opacity as 1.0 solves the problem.

Terry
0 Kudos