|Visual Basic (Declaration)|
<()> Public Class ValueMapRenderer(Of T As (Of T)) Implements IOverlayableRenderer, IRenderer, IJsonSerializable
|Visual Basic (Usage)||Copy Code|
- The type of the data to be used for assigning features to renderer groups (values).
This example creates a new ValueMapRenderer, adds two symbol classes to it, and then uses the renderer for a new graphics layer added to the map. To run this sample on a page:
- Create a new ASPX page.
- Add MapResourceManager, Map and Toc controls and set required properties (Map's MapResourceManager, Toc's Map properties).
- Add a resource item to the MapResourceManager with a map service, then add a second resource item with type GraphicsLayer with a name of "graphicsLayer0". Move the graphics resource to the top of the list of resources.
- Add the sample code into the Page_PreRender event handler method (create this method if necessary).
- Change the point x and y locations if necessary to fit within your map service's extent.
- Run the sample page. Two point symbols will be added to the map display.
|Visual Basic||Copy Code|
A ValueMapRenderer is used to symbolize a FeatureGraphicsLayer with multiple symbol types. Features in the graphics layer are assigned to symbol classes based on the value in a column of the graphics layer. The name of this column in the graphics layer must be copied to the ValueColumnName of the ValueMapRenderer.
At least two value classes should be added to the Values collection of the ValueMapRenderer. Each class is of a type derived from Value: either ValueRange, StringValue or UniqueValue. The value classes in a single ValueMapRenderer should be all of the same type. A ValueRange has upper and lower boundaries for assigning features based on a numeric-type column. A StringValue is used to assign features based on a string-type column. A UniqueValue is used to assign features based on exact matches to values.
Each value class needs a Symbol to enable rendering the features in the graphics layer. The symbols used must be appropriate for the FeatureType of the FeatureGraphicsLayer. For example, a graphics layer with polygons may be symbolized using a SimpleFillSymbol.
A ValueMapRenderer may optionally have a default symbol and label. The default symbol is used to display features that do not fall into one of the categories covered in the Values collection.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family