Select to view content in your preferred language

Can you render a mix of polygons, polylines and points in a FeatureLayer?

578
1
07-01-2010 07:02 PM
DavidAllen-Williams
Emerging Contributor
We have a MapIt service which points to a view containing a geography column that might be a polygon or a line depending on the record type. 

Can these be rendered using a single FeatureLayer?
i.e., I would want to use the same brush for a SimpleLineSymbol and SimpleFillSymbol, but just have the polygons filled.

Or do I need to split this into two separate FeatureLayers?
0 Kudos
1 Reply
dotMorten_esri
Esri Notable Contributor
The featurelayer expects a certain geometry type, so no you can't.

However the base GraphicsLayer does support a mix of geometry types, but the symbol for each graphic must match the geometry type of the geometry (ie fillsymbol for polygons, linesymbols for polylines, markersymbols for points/multipoints). You could create a custom IRenderer that returns the right symbol type based on the geometry.
You can still use the QueryTask to populate the graphicslayer against your "mixed table" from MapIt.
0 Kudos