public final class TLcdXYGridStyle extends Object
Style that can be used for XY grid layers. This style can be used to style the grid lines as well as the labels.
body
and label
. These methods can be called multiple times with different spacings in order to
add grid lines with different spacings. This makes it possible to for example add 100km and 10km grid lines and
labels.interval
method.lineColor
, lineWidth
, labelColor
, ...
The label text formatting can be customized using the format
method. Note that it
is possible to define multiple styles per grid line at different scales. This can for example be used to make
certain grid lines more prominent when zooming in by specifying multiple scale intervals with different styles.The following pseudo-code fragment shows how to use this style and its builder. This example shows how to define grid lines and labels with a spacing of 100km and 10km. For each line spacing, there are three intervals in which the lines/labels are visible. Each of these three intervals defines a different style. Because of this, the grid lines and labels will be styled differently, depending on the scale of the view.
TLcdXYGridStyle style = TLcdXYGridStyle.newBuilder()
.body(100000.0)
.interval(START_SCALE_100000, START_SCALE_10000).lineColor(primaryLineColor)
.interval(START_SCALE_10000, START_SCALE_1000).lineColor(secondaryLineColor)
.interval(START_SCALE_1000, MAX_ZOOMED_IN).lineColor(tertiaryLineColor)
.label(100000.0)
.interval(START_SCALE_100000, START_SCALE_10000).labelColor(primaryTextColor)
.interval(START_SCALE_10000, START_SCALE_1000).labelColor(secondaryTextColor)
.interval(START_SCALE_1000, MAX_ZOOMED_IN).labelColor(tertiaryTextColor)
.body(10000.0)
.interval(START_SCALE_10000, START_SCALE_1000).lineColor(primaryLineColor)
.interval(START_SCALE_1000, START_SCALE_100).lineColor(secondaryLineColor)
.interval(START_SCALE_100, MAX_ZOOMED_IN).lineColor(tertiaryLineColor)
.label(10000.0)
.interval(START_SCALE_10000, START_SCALE_1000).labelColor(primaryTextColor).format(numberFormat)
.interval(START_SCALE_1000, START_SCALE_100).labelColor(secondaryTextColor).format(numberFormat)
.interval(START_SCALE_100, MAX_ZOOMED_IN).labelColor(tertiaryTextColor).format(numberFormat)
...
.build();
Modifier and Type | Class and Description |
---|---|
static class |
TLcdXYGridStyle.Axis
The axis for which style information can be specified.
|
static class |
TLcdXYGridStyle.Builder<B extends TLcdXYGridStyle.Builder<B>>
Builder for XY styles.
|
Modifier and Type | Method and Description |
---|---|
TLcdXYGridStyle.Builder<?> |
asBuilder()
Creates a new builder initialized with all the properties of this style.
|
static TLcdXYGridStyle.Builder<?> |
newBuilder()
Creates a new builder with the default values.
|
public static TLcdXYGridStyle.Builder<?> newBuilder()
public TLcdXYGridStyle.Builder<?> asBuilder()