This describes the general interface for an InPathLabel style object.

An object literal containing placement instructions for label placement inside a closed shape (for example, a Polygon).

interface InPathLabelStyle {
    group?: string | number;
    inView?: boolean;
    padding?: number;
    priority?: number;
    restrictToBounds?: boolean;
}

Hierarchy (view full)

Properties

group?: string | number

The group name for this label style. This can be a custom name or the predefined constant: "NON_DECLUTTERED".

Labels that are painted with the same group name will automatically be decluttered, labels across different groups will not. The only exception to this is "NON_DECLUTTERED". When using this group, all labels inside this group will be painted without label decluttering. This parameter is optional. The default value is "DEFAULT". In practice, this means that - if no group is specified - all labels will be decluttered in the same group.

inView?: boolean

The flag to indicate if the label location should be recalculated to remain in the view if its shape is partially visible. By default, the flag is enabled.

NOTE: This flag is not supported in a hardware-accelerated map.

padding?: number

The amount of padding that should be added around the label. This value describes the amount in pixels by which the labels extent should grow for the decluttering purpose. A negative number will be ignored. This parameter is optional. The default is no padding.

priority?: number

Priority for this label style. A lower number means that the label will have a higher probability of being painted. If you do not explicitly assign a priority, the default priority of 0 is applied. The priority can be a negative number if you want to indicate that a label has a higher priority than the default.

restrictToBounds?: boolean

The flag that indicates if the label should be painted outside the bounds of its painted shape. When the value is "true" then the label is painted only if it is inside the painted shape's bounds. By default, the flag is disabled, which means this restriction is not applied.

NOTE: This flag is not supported in a hardware-accelerated map.

Since

2017.1