OverlayStyle
A JSON object that describes reusable styles for an overlay.
Declaration
object OverlayStyleProperties
| Name | Type | Description |
|---|---|---|
fillColor | string | The color used to fill the object. |
fillOpacity | number | The opacity value used to fill the object. |
fillRule | string | A rule used to determine the inside space of the polygon. Default: Options: |
lineCap | string | The style used for line end points. Default: Options: |
lineDash | [integer] | An array of integers that specifies the line’s dash pattern. |
lineDashOffset | integer | The line dash offset. |
lineGradient | OverlayStyle.LineGradient | An object that determines color stops for the gradient, positioned by offsets between 0 and 1. |
lineGradientIndexes | OverlayStyle.LineGradientIndexes | An object that determines where the color stops for the gradient. This property uses indexes of points on the polyline. |
lineJoin | string | The style used for joins between line segments. Options: |
lineWidth | integer | An integer in CSS pixels that specifies the width of the line. |
strokeColor | string | The color for stroking. |
strokeOpacity | number | 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 }]