Visualization

The visualization profile allows the map author to write an expression that evaluates to a value used to drive the visualization. This could be used for a visual variable such as size, or as a value in a class breaks renderer. When the feature is to be drawn, the script will be evaluated. It is expected that the script returns a value specific to the rendering property being calculated (e.g. A number for a class breaks visualization or text for a unique value visualization).

Context

This profile was created for use in the following contexts:

Profile variables

Variable NameTypeDescription
$featureFeatureThe feature which is to be drawn on the map.
$view.scaleNumberReturns the scale of the map at the time the expression evaluates. Only supported in 2D MapViews.

Function bundles

Core | Geometry

Return types

Text | Number

Example

Calculates the predominant political party within each feature.

Use dark colors for code blocksCopy
           
1
2
3
4
5
6
7
8
9
10
11
var republican = $feature.MP06025a_B;
var democrat = $feature.MP06024a_B;
var independent = $feature.MP06026a_B;
var parties = [republican, democrat, independent];

return Decode( Max(parties),
  republican, 'republican',
  democrat, 'democrat',
  independent, 'independent',
  'n/a'
);

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.