A parameterized point style that uses an Image or Canvas DOM element.

interface ImageParameterizedPointStyle {
    anchorX?: string;
    anchorY?: string;
    credentials?: boolean;
    height?: string;
    image: HTMLImageElement | HTMLCanvasElement;
    offsetX?: number;
    offsetY?: number;
    rotation?: number;
    width?: string;
}

Hierarchy (View Summary)

Properties

anchorX?: string

The x coordinate of the anchor for this icon. This can be either percentage or pixels. Example: "16px", or "50%". The default is "50%", which implies that the anchor-point is at the center of the image.

For example "http://www.example.com/image.png". have its anchor-point scaled.

The horizontal anchor-point is always defined from left to right. { anchorX:"0px" } is the left of the image, and positive values are points to the right.

"50%"
anchorY?: string

The y coordinate of the anchor for this icon. This can be either percentage or pixels. Example: "16px", or "50%". The default is "50%", which implies that the anchor-point is at the center of the image.

The anchor is always defined with respect to the original image size. This means that a scaled image will automatically have its anchor-point scaled.

The vertical anchor-point is always defined from top to bottom. { anchorY:"0px" } is the top of the image, and positive values are points to the bottom.

"50%"
credentials?: boolean

Whether the icon should be requested with authentication parameters. Setting this to true is required when the server requires cookies, basic http authentication, or OAuth authentication. This flag should be set to false if the server is configured to allow cross-origin requests from all hosts. Such servers reject all authenticated requests.

This parameter is only relevant when you are using the `ParameterizedPointStyle#url` property to request images. If you use the icon using the `ParameterizedPointStyle#image` property, the credentials are automatically handled by the browser.

The default value is false

false
height?: string

The target height of the image, with a given unit of measure. This can be either percentage or pixels. Example: "16px", or "50%". The default is "100%", which implies that the icon is painted at its original resolution.

"100%"

An Image or Canvas DOM element.

This image should either be a raster image, like a .png or .jpeg file, or be an image in SVG format.

offsetX?: number

The X offset in pixels that should be applied with respect to the location of the point. This offset is applied after rotation and does not take into account any scaling performed on the image. The default is 0, which means that the icon is painted at its anchor-point.

0
offsetY?: number

The Y offset in pixels that should be applied with respect to the location of the point. This offset is applied after rotation and does not take into account any scaling performed on the image. The default is 0, which means that the icon is painted at its anchor-point.

0
rotation?: number

The rotation of the icon, specified in degrees. The default is 0, which implies no rotation to the original icon. Rotations are applied in a clock-wise fashion. Rotation of the icon happens around its anchor-point.

0
width?: string

The target width of the image, with a given unit of measure. This can be either percentage or pixels. Example: "16px", or "50%". The default is "100%", which implies that the icon is painted at its original resolution.

"100%"