Classes
Type Definitions
-
Properties:
Name Type Argument Default Description anchorArray.<number> <optional>
[0.5, 0.5] Anchor. Default value is the icon center.
anchorOriginmodule:ol/style/IconOrigin <optional>
Origin of the anchor:
bottom-left,bottom-right,top-leftortop-right. Default istop-left.anchorXUnitsmodule:ol/style/IconAnchorUnits <optional>
Units in which the anchor x value is specified. A value of
'fraction'indicates the x value is a fraction of the icon. A value of'pixels'indicates the x value in pixels. Default is'fraction'.anchorYUnitsmodule:ol/style/IconAnchorUnits <optional>
Units in which the anchor y value is specified. A value of
'fraction'indicates the y value is a fraction of the icon. A value of'pixels'indicates the y value in pixels. Default is'fraction'.colormodule:ol/color~Color | string <optional>
Color to tint the icon. If not specified, the icon will be left as is.
crossOriginnull | string <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.imgHTMLImageElement | HTMLCanvasElement <optional>
Image object for the icon. If the
srcoption is not provided then the provided image must already be loaded. And in that case, it is required to provide the size of the image, with theimgSizeoption.offsetArray.<number> <optional>
[0, 0] Offset, which, together with the size and the offset origin, define the sub-rectangle to use from the original icon image.
offsetOriginmodule:ol/style/IconOrigin <optional>
Origin of the offset:
bottom-left,bottom-right,top-leftortop-right. Default istop-left.opacitynumber <optional>
1 Opacity of the icon.
scalenumber <optional>
1 Scale.
rotateWithViewboolean <optional>
false Whether to rotate the icon with the view.
rotationnumber <optional>
0 Rotation in radians (positive rotation clockwise).
sizemodule:ol/size~Size <optional>
Icon size in pixel. Can be used together with
offsetto define the sub-rectangle to use from the origin (sprite) icon image.imgSizemodule:ol/size~Size <optional>
Image size in pixels. Only required if
imgis set andsrcis not, and for SVG images in Internet Explorer 11. The providedimgSizeneeds to match the actual size of the image.srcstring <optional>
Image source URI.