The paint block
The paint block defines how feature geometries and raster pixels are rendered.
Properties common to all visualization types.
isClickable
boolean
true
Optional. A flag to tell if features should be clickable
isHoverable
boolean
false
Optional. A flag to tell if features should be hoverable
isSandwiched
boolean
true
Optional. A flag to tell if features affected by this visualization need to be rendered below the basemap road and water layers. Only applies to polygon features, point and line features are already rendered on top of the basemap
maxZoom
number
22
Optional. The maximum zoom level at which the visualization will be shown
minZoom
number
0
Optional. The minimum zoom level at which the visualization will be shown
renderAsLines
boolean
false
Optional. Decides if a polygon dataset should be render as lines thus making them render above the basemap. Note that using this requires that the style uses line properties instead of polygon ones.
Simple visualizations
The following properties are available for the simple
type of visualization
dashArray
number[]
Lines
Optional. The dash line definition
highlightColor
string
Points, lines and polygons
Optional. The color to be used when a feature is selected
highlightStrokeColor
string
Points, lines and polygons
Optional. The stroke color to be used when a feature is selected
lineCap
"butt"
| "round"
| "square"
| Interpolator
Lines
Optional. The shape used to draw the end points of lines
lineJoin
"bevel"
| "round"
| "miter"
| Interpolator
Lines
Optional. The shape used to join two line segments when they meet
See default values for the default values of these attributes on each geometry type.
Categorical and numeric visualizations
The following properties are available for the categorical
and numerical
type visualizations. (You can see an example of a categorical
visualization here)
dashArray
number[]
Lines
Optional. The dash line definition
lineCap
"butt"
| "round"
| "square"
| Interpolator
Lines
Optional. The shape used to draw the end points of lines
lineJoin
"bevel"
| "round"
| "miter"
| Interpolator
Lines
Optional. The shape used to join two line segments when they meet
Label block reference
These are the properties available to define label rendering. Anchors can be lines or points, polygons are not supported.
fontFamily
string
Points and lines
Optional. The font family to use
fontStyle
normal | italic | oblique
Points and lines
Optional. The font style
fontWeight
number
Points and lines
Optional. The font weight
letterSpacing
number
Points and lines
Optional. Horizontal spacing behaviour between text characters
lineHeight
number
Points and lines
Optional. Sets the height of a line box
maxLineChars
number | Interpolator
Points and lines
Optional. Defines the max number of characters before a line break
maxZoom
number
Points and lines
Optional. The maximum zoom level at which the label will be shown
minZoom
number
Points and lines
Optional. The minimum zoom level at which the label will be shown
offset
[number, number] | number
Points and lines
Optional. In the case of points, this value must be an array of two numeric offsets that will be applied on the positive X and Y axis defined by the label placement (i.e. an offset of [3,4] with a label placement of NE moves the label 3pixels to the right and 4 pixels above of the anchor point. An offset of [3,4] with a label placement of SW moves the label 3pixels to the left and 4 pixels below of the anchor point). In case of lines, this value is a single number that moves the label following the label position (i.e. an offset of 3 with a label position of Above will move the label 3 pixels above the line following the line normal. An offset of 3 with a label position of Below will mode the label 3 pixels under the line following the line normal)
padding
number
Points and lines
Optional. Adds invisible padding around the label that's used to compute label collisions
placement
TextPlacements[] | auto | LineLabelPlacement
Points and Lines
Optional. If defined on a points dataset, an array of label placements to test when placing the label. If all the placements collide with already existing labels, the label is not shown. If defined on a lines dataset, the label placement on a line
renderAsLines
boolean
Polygons
Optional. Renders labels along lines instead of using the centroids
repeatDistance
number
Lines
Optional. The distance in pixels between label repetitions on a line
textTransform
capitalize | uppercase | lowercase
Points and lines
Optional. Specifies how to capitalize the label
isClickable
boolean
Points, Lines and Polygons
Optional. A flag to tell if labels should be clickable
isHoverable
boolean
Points, Lines and Polygons
Optional. A flag to tell if labels should be hoverable
See default values of these attributes on each label type.
If using a categorical
or numeric
visualization, all the previous properties must be arrays. If there's a single value in the array, that value is used in all categories. If there are as many values as categories
, the corresponding value will be used for each category. You can see an example of a categorical
viz here.
Default values
color
"#EE4D5A"
"#826DBA"
"#4CC8A3"
highlightColor
"#EA3891"
"#EA3891"
"#EA3891"
highlightStrokeColor
"#EA3891"
"#EA3891"
"#EA3891"
dashArray
-
-
lineCap
-
-
"round"
lineJoin
-
-
"round"
opacity
0.9
0.8
1
isSandwiched
-
false
-
size
4
-
2
strokeColor
"#F9F8Fb"
"#777777"
-
strokeWidth
1
1
-
Last updated