Type Alias PolygonLayerOptions
fillColor?: string | ZoomStringValues;
fillOpacity?: ZoomNumberValues;
outlineBlur?: number | ZoomNumberValues;
outlineCap?: "butt" | "round" | "square";
outlineDashArray?: number[] | string;
outlineJoin?: "bevel" | "round" | "miter";
outlinePosition: "center" | "inside" | "outside";
pattern?: string | null;
}
Type Declaration
OptionalfillColor?: string | ZoomStringValuesOptionalfillOpacity?: ZoomNumberValuesOpacity of the polygon. This is can be a constant opacity in [0, 1] or a definition based on zoom levels Default:
1OptionaloutlineBlur?: number | ZoomNumberValuesHow blury the outline is, with
0being no blur and10and beyond being quite blurry. Applies only if.outlineistrue. Default:0OptionaloutlineCap?: "butt" | "round" | "square"The display of line endings for both the line and the outline (if
.outlineistrue)- "butt": A cap with a squared-off end which is drawn to the exact endpoint of the line.
- "round": A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
- "square": A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width. Default: "round"
OptionaloutlineDashArray?: number[] | stringSequence of line and void to create a dash pattern. The unit is the line width so that a dash array value of
[3, 1]will create a segment worth 3 times the width of the line, followed by a spacing worth 1 time the line width, and then repeat.Alternatively, this property can be a string made of underscore and whitespace characters such as
"___ _ "and internaly this will be translated into [3, 1, 1, 1]. Note that this way of describing dash arrays with a string only works for integer values.Dash arrays can contain more than 2 element to create more complex patters. For instance a dash array value of [3, 2, 1, 2] will create the following sequence:
- a segment worth 3 times the width
- a spacing worth 2 times the width
- a segment worth 1 times the width
- a spacing worth 2 times the width
- repeat
Default: no dash pattern
OptionaloutlineJoin?: "bevel" | "round" | "miter"The display of lines when joining for both the line and the outline (if
.outlineistrue)- "bevel": A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
- "round": A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
- "miter": A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet. Default: "round"
outlinePosition: "center" | "inside" | "outside"
Position of the outline with regard to the polygon edge (when
.outlineistrue) Default:"center"Optionalpattern?: string | nullThe pattern is an image URL to be put as a repeated background pattern of the polygon. Default:
null(no pattern,fillColorwill be used)
Color of the polygon. This is can be a constant color string or a definition based on zoom levels. Default: a color randomly pick from a list