Contents

OverlayStyle

A JSON object that describes reusable styles for an overlay.

Declaration

object OverlayStyle

Properties

NameTypeDescription
fillColorstring

The color used to fill the object.

fillOpacitynumber

The opacity value used to fill the object.

fillRulestring

A rule used to determine the inside space of the polygon.

Default: “nonzero”

Options: “nonzero” or “evenodd”

lineCapstring

The style used for line end points.

Default: “round”

Options: ”butt”, “round”, or “square”

lineDash[integer]

An array of integers that specifies the line’s dash pattern.

lineDashOffsetinteger

The line dash offset.

lineGradientOverlayStyle.LineGradient

An object that determines color stops for the gradient, positioned by offsets between 0 and 1.

"lineGradient": {"0": "green", "1": "blue"}
lineGradientIndexesOverlayStyle.LineGradientIndexes

An object that determines where the color stops for the gradient. This property uses indexes of points on the polyline.

"lineGradientIndexes": {"1": "blue"}
lineJoinstring

The style used for joins between line segments.

Options: ”miter”, “round”, or “bevel”

lineWidthinteger

An integer in CSS pixels that specifies the width of the line.

strokeColorstring

The color for stroking.

strokeOpacitynumber

The opacity value for stroking.

Discussion

You pass the OverlayStyle object properties from the overlayStyles query parameter. You can set the object properties and reuse the styles for multiple objects. Any changes made to an OverlayStyle object property automatically changes the styles associated with that object, unless they’re overwritten using the Overlay object.

The following example shows OverlayStyle properties passed into the overlayStyles query parameter:

/snapshot?center=0,0&z=7&overlays=[{
"type": "polygon",
"points":["1,1","1,-1","-1,-1","-1,1"],
"styleIdx": 2
}]
&overlayStyles=[{
"fillColor": "teal",
"fillOpacity": 0.7,
"strokeColor": "blue",
"lineCap": "square",
"lineWidth": 11,
"strokeOpacity": 0.7 }]

Topics

Objects

See Also

Essentials