Normalized MGRS style settings. All of the properties are defined, which is useful if you want to add UI that displays settings, but don't want to deal with undefined properties (properties that you didn't specify when you added the settings).

Since

2022.0

Hierarchy

Properties

labelEdgeOffset: number

This specifies the offset of the label, away from the edges of the view, in pixels.

It is applied for the labels of the current MGRS type/level/interval combination.

Default

6
labelFormat: null | string

The format pattern to use for the labels of the current MGRS type/level/interval combination. This pattern can be used to specify MGRS coordinates or UTM/UPS coordinates.

The format in BNF notation (expressions enclosed in [] brackets are optional, expressions enclosed in {} brackets may be omitted or repeated):

<pattern>          ::= [<zone>] [<separator> <band>] [<coordinates>]
<zone>             ::= "Z"
<band>             ::= "B"
<coordinates>      ::= <mgrs_coordinates> | <utm_coordinates>
<mgrs_coordinates> ::= [<separator> <id100k>] [<separator> <x> <separator> <y>]
<utm_coordinates>  ::= [<separator> <u> <separator> <v>]
<id100k>           ::= "S"
<x>                ::= "X" <mgrs_precision>
<y>                ::= "Y" <mgrs_precision>
<mgrs_precision>   ::= "0" | "1" | "2" | "3" | "4" | "5"
<u>                ::= "U" <utm_precision>
<v>                ::= "V" <utm_precision>
<utm_precision>    ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7"
<separator>        ::= { ? any character ? }
For example:
  • "33UES 12345 54321" has format "ZBS X5 Y5"
  • "33U 123456 7654321" has format "ZB U6 V7"

Depending on the label, only some parts of the format string will be used. For example, when displaying grid line labels, only the X or Y part of the format string will be used (e.g. it can be used to specify if "12345" or "1234" is displayed).

labelGridOffset: number

This specifies the offset (in pixels) of the label, away from the grid line to which it is attached.

It is applied for the labels of the current MGRS type/level/interval combination.

Default

3
labelLinePosition: GridLabelLinePosition

The label position (with respect to the line) to use for the line labels of the current MGRS type/level/interval combination. They can for example be placed at the left or at the right of the line.

Default

{@link GridLabelLinePosition.ABOVE_OR_LEFT}

Since

2022.0

labelOrientation: GridLabelOrientation

The label orientation to use for the line labels of the current MGRS type/level/interval combination.

Default

{@link GridLabelOrientation.ALONG_LINE}
labelPosition: GridLabelPosition

The label position (with respect to the view) to use for the line labels of the current MGRS type/level/interval combination. They can for example be placed at the left or at the right edge of the view, or both. For example, when a label is placed at the east or south side of a line, it will be placed at the left or lower edge of the view when using a rectangular projection like mercator.

Default

{@link GridLabelPosition.WEST_AND_SOUTH}
labelStyle: null | NormalizedMGRSLabelStyle
level: MGRSLevel

The MGRS level.

lineStyle: Required<Pick<LineStyle, "color" | "width">>
scaleRange: Interval

Applicable scale range.

The scale is a cartographic scale, which is the ratio of a distance on the screen to a distance in the real world.

min should be smaller than max. Smaller numbers represent more zoomed out scales, larger number represent more zoomed in scales. 0 represents the scale of a map zoomed out to infinity. Number.MAX_VALUE represents the scale of a map that's zoomed in to the maximum.

type: MGRSType

The MGRS type.