A FillStyle describes how an object should be filled. If the FillStyle doesn't have one of the following properties, it is considered as an empty fill.

Since

2013.0

Hierarchy

  • FillStyle

Properties

bloom?: BloomStyle

Adds a BloomEffect to the fill.

Bloom is only supported on WebGL maps.

Since

2022.1

color?: string

The fill color as a CSS color string. For example "rgb(125, 125, 125)" or "rgba(125, 125, 125, 0.5)".

When an url or image and the fill color are specified, the fill color will be used as fallback fill when the image cannot be loaded.

credentials?: boolean

Whether the image should be requested with authentication parameters. Setting this to true is required when the server requires cookies, basic http 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 `FillStyle#url` property to request images. If you use the image using the `FillStyle#image` property, the credentials are automatically handled by the browser.

By default false is used if not set

height?: string | number

The target height of the image, with a given unit of measure.

This can be either percentage, pixels or a length unit. For example: "16px", "50%" or "25.2m". Valid length units are uoms registered in LuciadRIA. The default is "100%", which implies that the image is painted at its original resolution.

If this is a number, the height is interpreted in the units defined by uom. If no uom is set, the height is interpreted in pixels.

You cannot mix world lengths and pixels for height and width. If height is expressed in a length unit, width must be as well (and vice-versa).

An Image or Canvas DOM element which will be used as fill. For example the HatchedImageBuilder class can be used to create such an image. This property cannot be combined with the url property.

When an url or image and the fill color are specified, the fill color will be used as fallback fill when the image cannot be loaded.

opacity?: number

The opacity of the image, determines how transparent an image will be painted. It's a numeric value between 0 and 1. 0 indicates that the image will be painted completely transparent and 1 indicates that the original image of the icon will be used.

This parameter is only relevant when you are using an image through either the `FillStyle#url` or the `FillStyle#image` properties. If you are use using the `FillStyle#color` property, the opacity from the specified color will be used instead.

By default 1 is used if not set.

rotation?: number

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

This parameter is only relevant when you are using an image through either the `FillStyle#url` or the `FillStyle#image` properties.

By default 0 is used if not set.

Determines the interpretation of units for height . When set to a length unit of measure (meters, feet,...), image fills will grow and shrink as you zoom the map in and out.

For georeferenced maps, supported UnitOfMeasures are:

  • getUnitOfMeasure("Pixels")
  • UnitOfMeasure of type getQuantityKind("Length"), for example getUnitOfMeasure("Meter")

The unit of measure applies to height. The uom determines the interpretation of the values as pixels or as a length unit that represents the actual size of real-world objects, like for example meter or foot.

The uom property is only supported on geographically referenced maps. Maps configured with a cartesian reference do not support FillStyles with a uom set.

The property is optional and the default value is the Pixel unit.

Since

2023.0

url?: string

A URL referring to an image resource which will be used as fill. For example "resources/img/hatch.png". This property cannot be combined with the image property.

When an url or image and the fill color are specified, the fill color will be used as fallback fill when the image cannot be loaded.

width?: string | number

The target width of the image, with a given unit of measure.

This can be either percentage, pixels or a length unit. For example: "16px", "50%" or "25.2m". Valid length units are uoms registered in LuciadRIA. The default is "100%", which implies that the image is painted at its original resolution.

If this is a number, the width is interpreted in the units defined by uom. If no uom is set, the height is interpreted in pixels.

You cannot mix world lengths and pixels for width and height. If width is expressed in a length unit, height must be as well (and vice-versa).

By default "100%" is used if not set