ReviewerMapServerHelper Class
Generates dynamic rendering options (see LayerDrawingOptions class) for Reviewer workspace results.
This class automatically generates symbols and colors based on the contents of your Reviewer workspace. Unique values in a DashboardResult are used to build UniqueValueRenderers. These renderers are applied through LayerDrawingOptions to the REVTABLEPOINT, REVTABLELINE, and REVTABLEPOLY layers in the ArcGIS Data Reviewer for Server Map Server.
Instances of this class keep a cache of the symbols and colors used to render the map. The colors are kept consistent if the extent of the features being drawn changes.
The colors are selected based on a predefined color palette that helps make each unique value distinguishable from each other. However, using more than 20 unique values is not recommended because the resulting rendered map will not be helpful for analysis. Colors are not randomly selected for Severity and LifecycleStatus fields. Instead, a predefined color scale is applied.
If you use a custom color map, the auto generated or predefined palettes are not used. The following rules apply if the color map doesn't contain enough values to represent all unique values in the DashboardResult:
- If useDefaultColorForMissingValues is set to false (default) in getLayerDrawingOptions, colors for any values missing from the colorMap are generated from the color palette.
- If useDefaultColorForMissingValues is set to true in getLayerDrawingOptions, the current defaultColor is assigned to all values missing from the colorMap. NOTE: If the DashboardResult fieldName property is set to either Severity or LifecycleStatus, useDefaultColorForMissingValues is always true.
Constructor
ReviewerMapServerHelper
-
drsSoeUrl
-
pointSymbol
-
lineSymbol
-
polySymbol
-
defaultColor
Parameters:
-
drsSoeUrl
StringArcGIS Data Reviewer for Server SOE (DataReviewerServer) URL.
-
pointSymbol
SimpleMarkerSymbolOptional SimpleMarkerSymbol used to render reviewer point results. The default symbol style is STYLE_CIRCLE and size 7.
-
lineSymbol
SimpleLineSymbolOptional SimpleLineSymbol used to render reviewer polyline results. The default symbol style is STYLE_SOLID, black, with an alpha of 1 and width of 4.
-
polySymbol
SimpleFillSymbolOptional SimpleFillSymbol used to render reviewer polygon results. The default symbol style is STYLE_SOLID, black, with an alpha of 1.
-
defaultColor
ColorOptional default color, specified as a dojo Color. Used when the system cannot determine a color to apply to a symbol.
Item Index
Properties
Methods
getLayerDrawingOptions
-
dashboardResult
-
colorMap
-
useDefaultColorForMissingValues
Creates LayerDrawingOptions for the reviewer map server's REVTABLEPOINT, REVTABLELINE, and REVTABLEPOLY layers. See DashboardResult, DashboardTask, dojo Color and defaultColor property.
Parameters:
-
dashboardResult
DashboardResultObtained from a query to Data Reviewer Server using the DashboardTask.getDashboardResult function.
-
colorMap
ObjectOptional custom color map object that contains key-value pairs. Keys are the unique values in dashboardResult. Values are dojo Colors.
-
useDefaultColorForMissingValues
Boolean(Optional) If false, colors for any values missing from the colorMap are generated from the color palette. If true, current defaultColor is assigned to all values missing from the colorMap. NOTE: If the DashboardResult fieldName property is set to either Severity or LifecycleStatus, useDefaultColorForMissingValues is always true.
Returns:
Example:
// Example colorMap for FEATUREOBJECTCLASS - keys (feature object classes) may be different.
// NOTE: You must require dojo/_base/Color to use the following code snippet.
var colorMap:Object = {"Roads": new Color([255, 0, 0, 0.5]), "Buildings": new Color([0, 255, 0, 0.5])};
Properties
defaultColor
Color
Sets the default color, specified as a dojo Color. Used when the system cannot determine a color to apply to a symbol. Write only.
lineSymbol
SimpleLineSymbol
Sets the symbol used to render the reviewer map server's REVTABLELINE layer. You can define the alpha, style and width properties. Color is determined by the DashboardResult and colorMap parameters passed to the getLayerDrawingOptions function.
pointSymbol
SimpleMarkerSymbol
Sets the symbol used to render the reviewer map server's REVTABLEPOINT layer. You can define the alpha, angle, outline, size, style, xoffset, and yoffset properties. Color is determined by the DashboardResult and colorMap parameters passed to the getLayerDrawingOptions function.
polySymbol
SimpleFillSymbol
Sets the symbol used to render the reviewer map server's REVTABLEPOLY layer. You can define the alpha, style and outline properties. Color is determined by the DashboardResult and colorMap parameters passed to the getLayerDrawingOptions function.
Events
onError
Event Payload:
-
error
Error
Example:
// connect to the onError event of the ReviewerMapServer Class
function onErrorHandler(error)
{
alert ("An error occurred. Error message = " +
error.message +" Error code = " +error.code);
}
onGetLayerDrawingOptionsComplete
Dispatched by getLayerDrawingOptions.