Settings that are used to style an MGRS grid.

See

MGRSGrid.setSettings

Since

2022.0

Hierarchy

  • MGRSGridSetting

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 | Pick<TextStyle, "font" | "fill" | "halo" | "haloWidth">

The style used to draw the grid labels. Null if you don't want to draw labels at this scale range.

Note that only the following TextStyle properties are supported for MGRS grid labels:

All other TextStyle properties will be ignored.

level: MGRSLevel

The MGRS level.

lineStyle: Pick<LineStyle, "color" | "width">

The style used to draw the grid lines.

Note that only the following LineStyle properties are supported for MGRS grid lines:

All other LineStyle properties will be ignored.

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.