@emuanalytics/flow-rdf-core 4.0.4 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -64
- package/dist/index.d.mts +36 -31
- package/dist/index.d.ts +36 -31
- package/dist/index.mjs +20 -3249
- package/dist/lib/context/context-registry.mjs +63 -0
- package/dist/lib/context/debugger.mjs +240 -0
- package/dist/lib/context/flow-context.mjs +61 -0
- package/dist/lib/context/global-state.mjs +70 -0
- package/dist/lib/context/map-registry.mjs +59 -0
- package/dist/lib/context/query-registry.mjs +53 -0
- package/dist/lib/errors/flow-error.mjs +10 -0
- package/dist/lib/errors/flow-expression-error.mjs +14 -0
- package/dist/lib/errors/flow-map-error.mjs +9 -0
- package/dist/lib/expressions/expression-parser.mjs +198 -0
- package/dist/lib/expressions/functions/from-palette.mjs +75 -0
- package/dist/lib/expressions/functions/regex.mjs +25 -0
- package/dist/lib/expressions/functions/state.mjs +25 -0
- package/dist/lib/expressions/parser-helpers.mjs +37 -0
- package/dist/lib/expressions/reactive-expression.mjs +253 -0
- package/dist/lib/map/flow-core-map.mjs +749 -0
- package/dist/lib/map/plugins/annotations/annotation-layers.mjs +163 -0
- package/dist/lib/map/plugins/annotations/annotation.events.mjs +27 -0
- package/dist/lib/map/plugins/annotations/annotation.plugin.mjs +498 -0
- package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/modes/DirectModeOverride.mjs +67 -0
- package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/modes/DragCircleMode.mjs +65 -0
- package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/utils/create_supplementary_points_circle.mjs +15 -0
- package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/utils/drag_pan.mjs +20 -0
- package/dist/lib/map/plugins/data-join.plugin.mjs +173 -0
- package/dist/lib/map/plugins/export/export.plugin.mjs +21 -0
- package/dist/lib/map/plugins/export/map-exporter.mjs +177 -0
- package/dist/lib/map/plugins/hover-effect.plugin.mjs +58 -0
- package/dist/lib/map/plugins/index.d.mts +37 -72
- package/dist/lib/map/plugins/index.d.ts +37 -72
- package/dist/lib/map/plugins/index.mjs +11 -1810
- package/dist/lib/map/plugins/keyboard-shortcut-manager.mjs +120 -0
- package/dist/lib/map/plugins/map-plugin-base.mjs +25 -0
- package/dist/lib/map/plugins/plugin-manager.mjs +135 -0
- package/dist/lib/map/plugins/popup.plugin.mjs +55 -0
- package/dist/lib/map/plugins/selection/selection.events.mjs +21 -0
- package/dist/lib/map/plugins/selection/selection.plugin.mjs +136 -0
- package/dist/lib/map/plugins/selection/source-selection.mjs +156 -0
- package/dist/lib/map/plugins/url-sync.plugin.mjs +55 -0
- package/dist/lib/map/support/image-registry.mjs +82 -0
- package/dist/lib/map/support/map-events.mjs +71 -0
- package/dist/lib/map/support/map-feature-stream.mjs +158 -0
- package/dist/lib/map/support/map-popup.mjs +159 -0
- package/dist/lib/map/types.mjs +7 -0
- package/dist/lib/map-style/map-data-source.mjs +192 -0
- package/dist/lib/map-style/map-layer-style-builder-generated.mjs +1307 -0
- package/dist/lib/map-style/map-layer-style-builder.mjs +86 -0
- package/dist/lib/map-style/map-layer.mjs +223 -0
- package/dist/lib/map-style/map-style.mjs +178 -0
- package/dist/lib/queries/async-committer.mjs +30 -0
- package/dist/lib/queries/query.mjs +172 -0
- package/dist/lib/state-store/decorators.mjs +83 -0
- package/dist/lib/state-store/state-store.mjs +534 -0
- package/dist/lib/state-store/utils.mjs +7 -0
- package/dist/lib/utils/announce.mjs +12 -0
- package/dist/lib/utils/assert.mjs +12 -0
- package/dist/{shared/flow-rdf-core.187cb345.mjs → lib/utils/debounce.mjs} +3 -39
- package/dist/lib/utils/decorators.mjs +59 -0
- package/dist/lib/utils/deferred.mjs +11 -0
- package/dist/lib/utils/ensure-array.mjs +16 -0
- package/dist/{shared/flow-rdf-core.1f0901c5.mjs → lib/utils/feature-type-checks.mjs} +2 -2
- package/dist/lib/utils/functional.mjs +22 -0
- package/dist/lib/utils/global.mjs +18 -0
- package/dist/lib/utils/index.mjs +8 -5
- package/dist/lib/utils/random-id.mjs +9 -0
- package/dist/lib/utils/string-utils.mjs +3 -0
- package/dist/lib/utils/throttle.mjs +20 -0
- package/dist/{shared/flow-rdf-core.25e5f6d7.mjs → lib/utils/type-checks.mjs} +1 -26
- package/dist/lib/utils/watchable-promise.mjs +55 -0
- package/dist/package.json.mjs +3 -0
- package/dist/shared/{flow-rdf-core.4dde996e.d.cts → flow-rdf-core.8b5acf14.d.mts} +1315 -172
- package/dist/shared/{flow-rdf-core.4dde996e.d.ts → flow-rdf-core.8b5acf14.d.ts} +1315 -172
- package/package.json +4 -8
- package/dist/index.cjs +0 -3316
- package/dist/index.d.cts +0 -90
- package/dist/lib/map/plugins/index.cjs +0 -1850
- package/dist/lib/map/plugins/index.d.cts +0 -345
- package/dist/lib/utils/index.cjs +0 -48
- package/dist/lib/utils/index.d.cts +0 -160
- package/dist/shared/flow-rdf-core.06e85a6c.cjs +0 -1394
- package/dist/shared/flow-rdf-core.4dde996e.d.mts +0 -1916
- package/dist/shared/flow-rdf-core.55c169ca.cjs +0 -150
- package/dist/shared/flow-rdf-core.63162669.d.cts +0 -10
- package/dist/shared/flow-rdf-core.65045caf.mjs +0 -1360
- package/dist/shared/flow-rdf-core.a82b9be4.cjs +0 -34
- package/dist/shared/flow-rdf-core.f50908f0.cjs +0 -102
|
@@ -0,0 +1,1307 @@
|
|
|
1
|
+
import { MapLayerStyleBuilder } from './map-layer-style-builder.mjs';
|
|
2
|
+
|
|
3
|
+
class FillLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
4
|
+
/**
|
|
5
|
+
* Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
|
|
6
|
+
*
|
|
7
|
+
* @param value - fill-sort-key value
|
|
8
|
+
*/
|
|
9
|
+
fillSortKey(value) {
|
|
10
|
+
this.addStyle("fill-sort-key", value);
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Whether or not the fill should be antialiased.
|
|
15
|
+
*
|
|
16
|
+
* @param value - fill-antialias value (default `true`)
|
|
17
|
+
*/
|
|
18
|
+
fillAntialias(value) {
|
|
19
|
+
this.addStyle("fill-antialias", value);
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.
|
|
24
|
+
*
|
|
25
|
+
* @param value - fill-opacity value (default `1`)
|
|
26
|
+
*/
|
|
27
|
+
fillOpacity(value) {
|
|
28
|
+
this.addStyle("fill-opacity", value);
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
|
|
33
|
+
*
|
|
34
|
+
* @param value - fill-color value (default `#000000`)
|
|
35
|
+
*/
|
|
36
|
+
fillColor(value) {
|
|
37
|
+
this.addStyle("fill-color", value);
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The outline color of the fill. Matches the value of `fill-color` if unspecified.
|
|
42
|
+
*
|
|
43
|
+
* @param value - fill-outline-color value
|
|
44
|
+
*/
|
|
45
|
+
fillOutlineColor(value) {
|
|
46
|
+
this.addStyle("fill-outline-color", value);
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
|
|
51
|
+
*
|
|
52
|
+
* @param value - fill-translate value in pixels (default `0,0`)
|
|
53
|
+
*/
|
|
54
|
+
fillTranslate(value) {
|
|
55
|
+
this.addStyle("fill-translate", value);
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Controls the frame of reference for `fill-translate`.
|
|
60
|
+
*
|
|
61
|
+
* Values:
|
|
62
|
+
* - map: The fill is translated relative to the map.
|
|
63
|
+
* - viewport: The fill is translated relative to the viewport.
|
|
64
|
+
*
|
|
65
|
+
* @param value - fill-translate-anchor value (default `map`)
|
|
66
|
+
*/
|
|
67
|
+
fillTranslateAnchor(value) {
|
|
68
|
+
this.addStyle("fill-translate-anchor", value);
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
|
|
73
|
+
*
|
|
74
|
+
* @param value - fill-pattern value
|
|
75
|
+
*/
|
|
76
|
+
fillPattern(value) {
|
|
77
|
+
this.addStyle("fill-pattern", value);
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
MapLayerStyleBuilder.registerStyleBuilder("fill", FillLayerStyleBuilder);
|
|
82
|
+
class LineLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
83
|
+
/**
|
|
84
|
+
* The display of line endings.
|
|
85
|
+
*
|
|
86
|
+
* Values:
|
|
87
|
+
* - butt: A cap with a squared-off end which is drawn to the exact endpoint of the line.
|
|
88
|
+
* - round: A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
|
|
89
|
+
* - square: A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
|
|
90
|
+
*
|
|
91
|
+
* @param value - line-cap value (default `butt`)
|
|
92
|
+
*/
|
|
93
|
+
lineCap(value) {
|
|
94
|
+
this.addStyle("line-cap", value);
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The display of lines when joining.
|
|
99
|
+
*
|
|
100
|
+
* Values:
|
|
101
|
+
* - bevel: A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
|
|
102
|
+
* - round: A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
|
|
103
|
+
* - miter: A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.
|
|
104
|
+
*
|
|
105
|
+
* @param value - line-join value (default `miter`)
|
|
106
|
+
*/
|
|
107
|
+
lineJoin(value) {
|
|
108
|
+
this.addStyle("line-join", value);
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Used to automatically convert miter joins to bevel joins for sharp angles.
|
|
113
|
+
*
|
|
114
|
+
* @param value - line-miter-limit value (default `2`)
|
|
115
|
+
*/
|
|
116
|
+
lineMiterLimit(value) {
|
|
117
|
+
this.addStyle("line-miter-limit", value);
|
|
118
|
+
return this;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Used to automatically convert round joins to miter joins for shallow angles.
|
|
122
|
+
*
|
|
123
|
+
* @param value - line-round-limit value (default `1.05`)
|
|
124
|
+
*/
|
|
125
|
+
lineRoundLimit(value) {
|
|
126
|
+
this.addStyle("line-round-limit", value);
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
|
|
131
|
+
*
|
|
132
|
+
* @param value - line-sort-key value
|
|
133
|
+
*/
|
|
134
|
+
lineSortKey(value) {
|
|
135
|
+
this.addStyle("line-sort-key", value);
|
|
136
|
+
return this;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The opacity at which the line will be drawn.
|
|
140
|
+
*
|
|
141
|
+
* @param value - line-opacity value (default `1`)
|
|
142
|
+
*/
|
|
143
|
+
lineOpacity(value) {
|
|
144
|
+
this.addStyle("line-opacity", value);
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* The color with which the line will be drawn.
|
|
149
|
+
*
|
|
150
|
+
* @param value - line-color value (default `#000000`)
|
|
151
|
+
*/
|
|
152
|
+
lineColor(value) {
|
|
153
|
+
this.addStyle("line-color", value);
|
|
154
|
+
return this;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
|
|
158
|
+
*
|
|
159
|
+
* @param value - line-translate value in pixels (default `0,0`)
|
|
160
|
+
*/
|
|
161
|
+
lineTranslate(value) {
|
|
162
|
+
this.addStyle("line-translate", value);
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Controls the frame of reference for `line-translate`.
|
|
167
|
+
*
|
|
168
|
+
* Values:
|
|
169
|
+
* - map: The line is translated relative to the map.
|
|
170
|
+
* - viewport: The line is translated relative to the viewport.
|
|
171
|
+
*
|
|
172
|
+
* @param value - line-translate-anchor value (default `map`)
|
|
173
|
+
*/
|
|
174
|
+
lineTranslateAnchor(value) {
|
|
175
|
+
this.addStyle("line-translate-anchor", value);
|
|
176
|
+
return this;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Stroke thickness.
|
|
180
|
+
*
|
|
181
|
+
* @param value - line-width value in pixels (default `1`)
|
|
182
|
+
*/
|
|
183
|
+
lineWidth(value) {
|
|
184
|
+
this.addStyle("line-width", value);
|
|
185
|
+
return this;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
|
|
189
|
+
*
|
|
190
|
+
* @param value - line-gap-width value in pixels
|
|
191
|
+
*/
|
|
192
|
+
lineGapWidth(value) {
|
|
193
|
+
this.addStyle("line-gap-width", value);
|
|
194
|
+
return this;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.
|
|
198
|
+
*
|
|
199
|
+
* @param value - line-offset value in pixels
|
|
200
|
+
*/
|
|
201
|
+
lineOffset(value) {
|
|
202
|
+
this.addStyle("line-offset", value);
|
|
203
|
+
return this;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Blur applied to the line, in pixels.
|
|
207
|
+
*
|
|
208
|
+
* @param value - line-blur value in pixels
|
|
209
|
+
*/
|
|
210
|
+
lineBlur(value) {
|
|
211
|
+
this.addStyle("line-blur", value);
|
|
212
|
+
return this;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.
|
|
216
|
+
*
|
|
217
|
+
* @param value - line-dasharray value in line widths
|
|
218
|
+
*/
|
|
219
|
+
lineDasharray(value) {
|
|
220
|
+
this.addStyle("line-dasharray", value);
|
|
221
|
+
return this;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
|
|
225
|
+
*
|
|
226
|
+
* @param value - line-pattern value
|
|
227
|
+
*/
|
|
228
|
+
linePattern(value) {
|
|
229
|
+
this.addStyle("line-pattern", value);
|
|
230
|
+
return this;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.
|
|
234
|
+
*
|
|
235
|
+
* @param value - line-gradient value
|
|
236
|
+
*/
|
|
237
|
+
lineGradient(value) {
|
|
238
|
+
this.addStyle("line-gradient", value);
|
|
239
|
+
return this;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
MapLayerStyleBuilder.registerStyleBuilder("line", LineLayerStyleBuilder);
|
|
243
|
+
class SymbolLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
244
|
+
/**
|
|
245
|
+
* Label placement relative to its geometry.
|
|
246
|
+
*
|
|
247
|
+
* Values:
|
|
248
|
+
* - point: The label is placed at the point where the geometry is located.
|
|
249
|
+
* - line: The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries.
|
|
250
|
+
* - line-center: The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries.
|
|
251
|
+
*
|
|
252
|
+
* @param value - symbol-placement value (default `point`)
|
|
253
|
+
*/
|
|
254
|
+
symbolPlacement(value) {
|
|
255
|
+
this.addStyle("symbol-placement", value);
|
|
256
|
+
return this;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Distance between two symbol anchors.
|
|
260
|
+
*
|
|
261
|
+
* @param value - symbol-spacing value in pixels (default `250`)
|
|
262
|
+
*/
|
|
263
|
+
symbolSpacing(value) {
|
|
264
|
+
this.addStyle("symbol-spacing", value);
|
|
265
|
+
return this;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.
|
|
269
|
+
*
|
|
270
|
+
* @param value - symbol-avoid-edges value
|
|
271
|
+
*/
|
|
272
|
+
symbolAvoidEdges(value) {
|
|
273
|
+
this.addStyle("symbol-avoid-edges", value);
|
|
274
|
+
return this;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.
|
|
278
|
+
*
|
|
279
|
+
* @param value - symbol-sort-key value
|
|
280
|
+
*/
|
|
281
|
+
symbolSortKey(value) {
|
|
282
|
+
this.addStyle("symbol-sort-key", value);
|
|
283
|
+
return this;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.
|
|
287
|
+
*
|
|
288
|
+
* Values:
|
|
289
|
+
* - auto: Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`.
|
|
290
|
+
* - viewport-y: Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`.
|
|
291
|
+
* - source: Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data.
|
|
292
|
+
*
|
|
293
|
+
* @param value - symbol-z-order value (default `auto`)
|
|
294
|
+
*/
|
|
295
|
+
symbolZOrder(value) {
|
|
296
|
+
this.addStyle("symbol-z-order", value);
|
|
297
|
+
return this;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* If true, the icon will be visible even if it collides with other previously drawn symbols.
|
|
301
|
+
*
|
|
302
|
+
* @param value - icon-allow-overlap value
|
|
303
|
+
*/
|
|
304
|
+
iconAllowOverlap(value) {
|
|
305
|
+
this.addStyle("icon-allow-overlap", value);
|
|
306
|
+
return this;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Allows for control over whether to show an icon when it overlaps other symbols on the map. If `icon-overlap` is not set, `icon-allow-overlap` is used instead.
|
|
310
|
+
*
|
|
311
|
+
* Values:
|
|
312
|
+
* - never: The icon will be hidden if it collides with any other previously drawn symbol.
|
|
313
|
+
* - always: The icon will be visible even if it collides with any other previously drawn symbol.
|
|
314
|
+
* - cooperative: If the icon collides with another previously drawn symbol, the overlap mode for that symbol is checked. If the previous symbol was placed using `never` overlap mode, the new icon is hidden. If the previous symbol was placed using `always` or `cooperative` overlap mode, the new icon is visible.
|
|
315
|
+
*
|
|
316
|
+
* @param value - icon-overlap value
|
|
317
|
+
*/
|
|
318
|
+
iconOverlap(value) {
|
|
319
|
+
this.addStyle("icon-overlap", value);
|
|
320
|
+
return this;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* If true, other symbols can be visible even if they collide with the icon.
|
|
324
|
+
*
|
|
325
|
+
* @param value - icon-ignore-placement value
|
|
326
|
+
*/
|
|
327
|
+
iconIgnorePlacement(value) {
|
|
328
|
+
this.addStyle("icon-ignore-placement", value);
|
|
329
|
+
return this;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
|
|
333
|
+
*
|
|
334
|
+
* @param value - icon-optional value
|
|
335
|
+
*/
|
|
336
|
+
iconOptional(value) {
|
|
337
|
+
this.addStyle("icon-optional", value);
|
|
338
|
+
return this;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* In combination with `symbol-placement`, determines the rotation behavior of icons.
|
|
342
|
+
*
|
|
343
|
+
* Values:
|
|
344
|
+
* - map: When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line.
|
|
345
|
+
* - viewport: Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`.
|
|
346
|
+
* - auto: When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`.
|
|
347
|
+
*
|
|
348
|
+
* @param value - icon-rotation-alignment value (default `auto`)
|
|
349
|
+
*/
|
|
350
|
+
iconRotationAlignment(value) {
|
|
351
|
+
this.addStyle("icon-rotation-alignment", value);
|
|
352
|
+
return this;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.
|
|
356
|
+
*
|
|
357
|
+
* @param value - icon-size value in factor of the original icon size (default `1`)
|
|
358
|
+
*/
|
|
359
|
+
iconSize(value) {
|
|
360
|
+
this.addStyle("icon-size", value);
|
|
361
|
+
return this;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Scales the icon to fit around the associated text.
|
|
365
|
+
*
|
|
366
|
+
* Values:
|
|
367
|
+
* - none: The icon is displayed at its intrinsic aspect ratio.
|
|
368
|
+
* - width: The icon is scaled in the x-dimension to fit the width of the text.
|
|
369
|
+
* - height: The icon is scaled in the y-dimension to fit the height of the text.
|
|
370
|
+
* - both: The icon is scaled in both x- and y-dimensions.
|
|
371
|
+
*
|
|
372
|
+
* @param value - icon-text-fit value (default `none`)
|
|
373
|
+
*/
|
|
374
|
+
iconTextFit(value) {
|
|
375
|
+
this.addStyle("icon-text-fit", value);
|
|
376
|
+
return this;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.
|
|
380
|
+
*
|
|
381
|
+
* @param value - icon-text-fit-padding value in pixels (default `0,0,0,0`)
|
|
382
|
+
*/
|
|
383
|
+
iconTextFitPadding(value) {
|
|
384
|
+
this.addStyle("icon-text-fit-padding", value);
|
|
385
|
+
return this;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Name of image in sprite to use for drawing an image background.
|
|
389
|
+
*
|
|
390
|
+
* @param value - icon-image value
|
|
391
|
+
*/
|
|
392
|
+
iconImage(value) {
|
|
393
|
+
this.addStyle("icon-image", value);
|
|
394
|
+
return this;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Rotates the icon clockwise.
|
|
398
|
+
*
|
|
399
|
+
* @param value - icon-rotate value in degrees
|
|
400
|
+
*/
|
|
401
|
+
iconRotate(value) {
|
|
402
|
+
this.addStyle("icon-rotate", value);
|
|
403
|
+
return this;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Size of additional area round the icon bounding box used for detecting symbol collisions. Values are declared using CSS margin shorthand syntax: a single value applies to all four sides; two values apply to [top/bottom, left/right]; three values apply to [top, left/right, bottom]; four values apply to [top, right, bottom, left]. For backwards compatibility, a single bare number is accepted, and treated the same as a one-element array - padding applied to all sides.
|
|
407
|
+
*
|
|
408
|
+
* @param value - icon-padding value in pixels (default `2`)
|
|
409
|
+
*/
|
|
410
|
+
iconPadding(value) {
|
|
411
|
+
this.addStyle("icon-padding", value);
|
|
412
|
+
return this;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* If true, the icon may be flipped to prevent it from being rendered upside-down.
|
|
416
|
+
*
|
|
417
|
+
* @param value - icon-keep-upright value
|
|
418
|
+
*/
|
|
419
|
+
iconKeepUpright(value) {
|
|
420
|
+
this.addStyle("icon-keep-upright", value);
|
|
421
|
+
return this;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.
|
|
425
|
+
*
|
|
426
|
+
* @param value - icon-offset value (default `0,0`)
|
|
427
|
+
*/
|
|
428
|
+
iconOffset(value) {
|
|
429
|
+
this.addStyle("icon-offset", value);
|
|
430
|
+
return this;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Part of the icon placed closest to the anchor.
|
|
434
|
+
*
|
|
435
|
+
* Values:
|
|
436
|
+
* - center: The center of the icon is placed closest to the anchor.
|
|
437
|
+
* - left: The left side of the icon is placed closest to the anchor.
|
|
438
|
+
* - right: The right side of the icon is placed closest to the anchor.
|
|
439
|
+
* - top: The top of the icon is placed closest to the anchor.
|
|
440
|
+
* - bottom: The bottom of the icon is placed closest to the anchor.
|
|
441
|
+
* - top-left: The top left corner of the icon is placed closest to the anchor.
|
|
442
|
+
* - top-right: The top right corner of the icon is placed closest to the anchor.
|
|
443
|
+
* - bottom-left: The bottom left corner of the icon is placed closest to the anchor.
|
|
444
|
+
* - bottom-right: The bottom right corner of the icon is placed closest to the anchor.
|
|
445
|
+
*
|
|
446
|
+
* @param value - icon-anchor value (default `center`)
|
|
447
|
+
*/
|
|
448
|
+
iconAnchor(value) {
|
|
449
|
+
this.addStyle("icon-anchor", value);
|
|
450
|
+
return this;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Orientation of icon when map is pitched.
|
|
454
|
+
*
|
|
455
|
+
* Values:
|
|
456
|
+
* - map: The icon is aligned to the plane of the map.
|
|
457
|
+
* - viewport: The icon is aligned to the plane of the viewport.
|
|
458
|
+
* - auto: Automatically matches the value of `icon-rotation-alignment`.
|
|
459
|
+
*
|
|
460
|
+
* @param value - icon-pitch-alignment value (default `auto`)
|
|
461
|
+
*/
|
|
462
|
+
iconPitchAlignment(value) {
|
|
463
|
+
this.addStyle("icon-pitch-alignment", value);
|
|
464
|
+
return this;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Orientation of text when map is pitched.
|
|
468
|
+
*
|
|
469
|
+
* Values:
|
|
470
|
+
* - map: The text is aligned to the plane of the map.
|
|
471
|
+
* - viewport: The text is aligned to the plane of the viewport.
|
|
472
|
+
* - auto: Automatically matches the value of `text-rotation-alignment`.
|
|
473
|
+
*
|
|
474
|
+
* @param value - text-pitch-alignment value (default `auto`)
|
|
475
|
+
*/
|
|
476
|
+
textPitchAlignment(value) {
|
|
477
|
+
this.addStyle("text-pitch-alignment", value);
|
|
478
|
+
return this;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
|
|
482
|
+
*
|
|
483
|
+
* Values:
|
|
484
|
+
* - map: When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line.
|
|
485
|
+
* - viewport: Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`.
|
|
486
|
+
* - viewport-glyph: When `symbol-placement` is set to `point`, aligns text to the x-axis of the viewport. When `symbol-placement` is set to `line` or `line-center`, aligns glyphs to the x-axis of the viewport and places them along the line.
|
|
487
|
+
* - auto: When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`.
|
|
488
|
+
*
|
|
489
|
+
* @param value - text-rotation-alignment value (default `auto`)
|
|
490
|
+
*/
|
|
491
|
+
textRotationAlignment(value) {
|
|
492
|
+
this.addStyle("text-rotation-alignment", value);
|
|
493
|
+
return this;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.
|
|
497
|
+
*
|
|
498
|
+
* @param value - text-field value
|
|
499
|
+
*/
|
|
500
|
+
textField(value) {
|
|
501
|
+
this.addStyle("text-field", value);
|
|
502
|
+
return this;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Font stack to use for displaying text.
|
|
506
|
+
*
|
|
507
|
+
* @param value - text-font value (default `Open Sans Regular,Arial Unicode MS Regular`)
|
|
508
|
+
*/
|
|
509
|
+
textFont(value) {
|
|
510
|
+
this.addStyle("text-font", value);
|
|
511
|
+
return this;
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Font size.
|
|
515
|
+
*
|
|
516
|
+
* @param value - text-size value in pixels (default `16`)
|
|
517
|
+
*/
|
|
518
|
+
textSize(value) {
|
|
519
|
+
this.addStyle("text-size", value);
|
|
520
|
+
return this;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* The maximum line width for text wrapping.
|
|
524
|
+
*
|
|
525
|
+
* @param value - text-max-width value in ems (default `10`)
|
|
526
|
+
*/
|
|
527
|
+
textMaxWidth(value) {
|
|
528
|
+
this.addStyle("text-max-width", value);
|
|
529
|
+
return this;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Text leading value for multi-line text.
|
|
533
|
+
*
|
|
534
|
+
* @param value - text-line-height value in ems (default `1.2`)
|
|
535
|
+
*/
|
|
536
|
+
textLineHeight(value) {
|
|
537
|
+
this.addStyle("text-line-height", value);
|
|
538
|
+
return this;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Text tracking amount.
|
|
542
|
+
*
|
|
543
|
+
* @param value - text-letter-spacing value in ems
|
|
544
|
+
*/
|
|
545
|
+
textLetterSpacing(value) {
|
|
546
|
+
this.addStyle("text-letter-spacing", value);
|
|
547
|
+
return this;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Text justification options.
|
|
551
|
+
*
|
|
552
|
+
* Values:
|
|
553
|
+
* - auto: The text is aligned towards the anchor position.
|
|
554
|
+
* - left: The text is aligned to the left.
|
|
555
|
+
* - center: The text is centered.
|
|
556
|
+
* - right: The text is aligned to the right.
|
|
557
|
+
*
|
|
558
|
+
* @param value - text-justify value (default `center`)
|
|
559
|
+
*/
|
|
560
|
+
textJustify(value) {
|
|
561
|
+
this.addStyle("text-justify", value);
|
|
562
|
+
return this;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.
|
|
566
|
+
*
|
|
567
|
+
* @param value - text-radial-offset value in ems
|
|
568
|
+
*/
|
|
569
|
+
textRadialOffset(value) {
|
|
570
|
+
this.addStyle("text-radial-offset", value);
|
|
571
|
+
return this;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.
|
|
575
|
+
*
|
|
576
|
+
* Values:
|
|
577
|
+
* - center: The center of the text is placed closest to the anchor.
|
|
578
|
+
* - left: The left side of the text is placed closest to the anchor.
|
|
579
|
+
* - right: The right side of the text is placed closest to the anchor.
|
|
580
|
+
* - top: The top of the text is placed closest to the anchor.
|
|
581
|
+
* - bottom: The bottom of the text is placed closest to the anchor.
|
|
582
|
+
* - top-left: The top left corner of the text is placed closest to the anchor.
|
|
583
|
+
* - top-right: The top right corner of the text is placed closest to the anchor.
|
|
584
|
+
* - bottom-left: The bottom left corner of the text is placed closest to the anchor.
|
|
585
|
+
* - bottom-right: The bottom right corner of the text is placed closest to the anchor.
|
|
586
|
+
*
|
|
587
|
+
* @param value - text-variable-anchor value
|
|
588
|
+
*/
|
|
589
|
+
textVariableAnchor(value) {
|
|
590
|
+
this.addStyle("text-variable-anchor", value);
|
|
591
|
+
return this;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations, each paired with an offset value. The renderer will attempt to place the label at each location, in order, before moving on to the next location+offset. Use `text-justify: auto` to choose justification based on anchor position.
|
|
595
|
+
|
|
596
|
+
The length of the array must be even, and must alternate between enum and point entries. i.e., each anchor location must be accompanied by a point, and that point defines the offset when the corresponding anchor location is used. Positive offset values indicate right and down, while negative values indicate left and up. Anchor locations may repeat, allowing the renderer to try multiple offsets to try and place a label using the same anchor.
|
|
597
|
+
|
|
598
|
+
When present, this property takes precedence over `text-anchor`, `text-variable-anchor`, `text-offset`, and `text-radial-offset`.
|
|
599
|
+
|
|
600
|
+
```json
|
|
601
|
+
{ "text-variable-anchor-offset": ["top", [0, 4], "left", [3,0], "bottom", [1, 1]] }
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
When the renderer chooses the `top` anchor, `[0, 4]` will be used for `text-offset`; the text will be shifted down by 4 ems.
|
|
605
|
+
|
|
606
|
+
When the renderer chooses the `left` anchor, `[3, 0]` will be used for `text-offset`; the text will be shifted right by 3 ems.
|
|
607
|
+
*
|
|
608
|
+
* @param value - text-variable-anchor-offset value
|
|
609
|
+
*/
|
|
610
|
+
textVariableAnchorOffset(value) {
|
|
611
|
+
this.addStyle("text-variable-anchor-offset", value);
|
|
612
|
+
return this;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Part of the text placed closest to the anchor.
|
|
616
|
+
*
|
|
617
|
+
* Values:
|
|
618
|
+
* - center: The center of the text is placed closest to the anchor.
|
|
619
|
+
* - left: The left side of the text is placed closest to the anchor.
|
|
620
|
+
* - right: The right side of the text is placed closest to the anchor.
|
|
621
|
+
* - top: The top of the text is placed closest to the anchor.
|
|
622
|
+
* - bottom: The bottom of the text is placed closest to the anchor.
|
|
623
|
+
* - top-left: The top left corner of the text is placed closest to the anchor.
|
|
624
|
+
* - top-right: The top right corner of the text is placed closest to the anchor.
|
|
625
|
+
* - bottom-left: The bottom left corner of the text is placed closest to the anchor.
|
|
626
|
+
* - bottom-right: The bottom right corner of the text is placed closest to the anchor.
|
|
627
|
+
*
|
|
628
|
+
* @param value - text-anchor value (default `center`)
|
|
629
|
+
*/
|
|
630
|
+
textAnchor(value) {
|
|
631
|
+
this.addStyle("text-anchor", value);
|
|
632
|
+
return this;
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Maximum angle change between adjacent characters.
|
|
636
|
+
*
|
|
637
|
+
* @param value - text-max-angle value in degrees (default `45`)
|
|
638
|
+
*/
|
|
639
|
+
textMaxAngle(value) {
|
|
640
|
+
this.addStyle("text-max-angle", value);
|
|
641
|
+
return this;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.
|
|
645
|
+
*
|
|
646
|
+
* Values:
|
|
647
|
+
* - horizontal: If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally.
|
|
648
|
+
* - vertical: If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically.
|
|
649
|
+
*
|
|
650
|
+
* @param value - text-writing-mode value
|
|
651
|
+
*/
|
|
652
|
+
textWritingMode(value) {
|
|
653
|
+
this.addStyle("text-writing-mode", value);
|
|
654
|
+
return this;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Rotates the text clockwise.
|
|
658
|
+
*
|
|
659
|
+
* @param value - text-rotate value in degrees
|
|
660
|
+
*/
|
|
661
|
+
textRotate(value) {
|
|
662
|
+
this.addStyle("text-rotate", value);
|
|
663
|
+
return this;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Size of the additional area around the text bounding box used for detecting symbol collisions.
|
|
667
|
+
*
|
|
668
|
+
* @param value - text-padding value in pixels (default `2`)
|
|
669
|
+
*/
|
|
670
|
+
textPadding(value) {
|
|
671
|
+
this.addStyle("text-padding", value);
|
|
672
|
+
return this;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* If true, the text may be flipped vertically to prevent it from being rendered upside-down.
|
|
676
|
+
*
|
|
677
|
+
* @param value - text-keep-upright value (default `true`)
|
|
678
|
+
*/
|
|
679
|
+
textKeepUpright(value) {
|
|
680
|
+
this.addStyle("text-keep-upright", value);
|
|
681
|
+
return this;
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Specifies how to capitalize text, similar to the CSS `text-transform` property.
|
|
685
|
+
*
|
|
686
|
+
* Values:
|
|
687
|
+
* - none: The text is not altered.
|
|
688
|
+
* - uppercase: Forces all letters to be displayed in uppercase.
|
|
689
|
+
* - lowercase: Forces all letters to be displayed in lowercase.
|
|
690
|
+
*
|
|
691
|
+
* @param value - text-transform value (default `none`)
|
|
692
|
+
*/
|
|
693
|
+
textTransform(value) {
|
|
694
|
+
this.addStyle("text-transform", value);
|
|
695
|
+
return this;
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.
|
|
699
|
+
*
|
|
700
|
+
* @param value - text-offset value in ems (default `0,0`)
|
|
701
|
+
*/
|
|
702
|
+
textOffset(value) {
|
|
703
|
+
this.addStyle("text-offset", value);
|
|
704
|
+
return this;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* If true, the text will be visible even if it collides with other previously drawn symbols.
|
|
708
|
+
*
|
|
709
|
+
* @param value - text-allow-overlap value
|
|
710
|
+
*/
|
|
711
|
+
textAllowOverlap(value) {
|
|
712
|
+
this.addStyle("text-allow-overlap", value);
|
|
713
|
+
return this;
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Allows for control over whether to show symbol text when it overlaps other symbols on the map. If `text-overlap` is not set, `text-allow-overlap` is used instead
|
|
717
|
+
*
|
|
718
|
+
* Values:
|
|
719
|
+
* - never: The text will be hidden if it collides with any other previously drawn symbol.
|
|
720
|
+
* - always: The text will be visible even if it collides with any other previously drawn symbol.
|
|
721
|
+
* - cooperative: If the text collides with another previously drawn symbol, the overlap mode for that symbol is checked. If the previous symbol was placed using `never` overlap mode, the new text is hidden. If the previous symbol was placed using `always` or `cooperative` overlap mode, the new text is visible.
|
|
722
|
+
*
|
|
723
|
+
* @param value - text-overlap value
|
|
724
|
+
*/
|
|
725
|
+
textOverlap(value) {
|
|
726
|
+
this.addStyle("text-overlap", value);
|
|
727
|
+
return this;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* If true, other symbols can be visible even if they collide with the text.
|
|
731
|
+
*
|
|
732
|
+
* @param value - text-ignore-placement value
|
|
733
|
+
*/
|
|
734
|
+
textIgnorePlacement(value) {
|
|
735
|
+
this.addStyle("text-ignore-placement", value);
|
|
736
|
+
return this;
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
|
|
740
|
+
*
|
|
741
|
+
* @param value - text-optional value
|
|
742
|
+
*/
|
|
743
|
+
textOptional(value) {
|
|
744
|
+
this.addStyle("text-optional", value);
|
|
745
|
+
return this;
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* The opacity at which the icon will be drawn.
|
|
749
|
+
*
|
|
750
|
+
* @param value - icon-opacity value (default `1`)
|
|
751
|
+
*/
|
|
752
|
+
iconOpacity(value) {
|
|
753
|
+
this.addStyle("icon-opacity", value);
|
|
754
|
+
return this;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* The color of the icon. This can only be used with sdf icons.
|
|
758
|
+
*
|
|
759
|
+
* @param value - icon-color value (default `#000000`)
|
|
760
|
+
*/
|
|
761
|
+
iconColor(value) {
|
|
762
|
+
this.addStyle("icon-color", value);
|
|
763
|
+
return this;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* The color of the icon's halo. Icon halos can only be used with SDF icons.
|
|
767
|
+
*
|
|
768
|
+
* @param value - icon-halo-color value (default `rgba(0, 0, 0, 0)`)
|
|
769
|
+
*/
|
|
770
|
+
iconHaloColor(value) {
|
|
771
|
+
this.addStyle("icon-halo-color", value);
|
|
772
|
+
return this;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Distance of halo to the icon outline.
|
|
776
|
+
*
|
|
777
|
+
* @param value - icon-halo-width value in pixels
|
|
778
|
+
*/
|
|
779
|
+
iconHaloWidth(value) {
|
|
780
|
+
this.addStyle("icon-halo-width", value);
|
|
781
|
+
return this;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Fade out the halo towards the outside.
|
|
785
|
+
*
|
|
786
|
+
* @param value - icon-halo-blur value in pixels
|
|
787
|
+
*/
|
|
788
|
+
iconHaloBlur(value) {
|
|
789
|
+
this.addStyle("icon-halo-blur", value);
|
|
790
|
+
return this;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
|
|
794
|
+
*
|
|
795
|
+
* @param value - icon-translate value in pixels (default `0,0`)
|
|
796
|
+
*/
|
|
797
|
+
iconTranslate(value) {
|
|
798
|
+
this.addStyle("icon-translate", value);
|
|
799
|
+
return this;
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Controls the frame of reference for `icon-translate`.
|
|
803
|
+
*
|
|
804
|
+
* Values:
|
|
805
|
+
* - map: Icons are translated relative to the map.
|
|
806
|
+
* - viewport: Icons are translated relative to the viewport.
|
|
807
|
+
*
|
|
808
|
+
* @param value - icon-translate-anchor value (default `map`)
|
|
809
|
+
*/
|
|
810
|
+
iconTranslateAnchor(value) {
|
|
811
|
+
this.addStyle("icon-translate-anchor", value);
|
|
812
|
+
return this;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* The opacity at which the text will be drawn.
|
|
816
|
+
*
|
|
817
|
+
* @param value - text-opacity value (default `1`)
|
|
818
|
+
*/
|
|
819
|
+
textOpacity(value) {
|
|
820
|
+
this.addStyle("text-opacity", value);
|
|
821
|
+
return this;
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* The color with which the text will be drawn.
|
|
825
|
+
*
|
|
826
|
+
* @param value - text-color value (default `#000000`)
|
|
827
|
+
*/
|
|
828
|
+
textColor(value) {
|
|
829
|
+
this.addStyle("text-color", value);
|
|
830
|
+
return this;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* The color of the text's halo, which helps it stand out from backgrounds.
|
|
834
|
+
*
|
|
835
|
+
* @param value - text-halo-color value (default `rgba(0, 0, 0, 0)`)
|
|
836
|
+
*/
|
|
837
|
+
textHaloColor(value) {
|
|
838
|
+
this.addStyle("text-halo-color", value);
|
|
839
|
+
return this;
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.
|
|
843
|
+
*
|
|
844
|
+
* @param value - text-halo-width value in pixels
|
|
845
|
+
*/
|
|
846
|
+
textHaloWidth(value) {
|
|
847
|
+
this.addStyle("text-halo-width", value);
|
|
848
|
+
return this;
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* The halo's fadeout distance towards the outside.
|
|
852
|
+
*
|
|
853
|
+
* @param value - text-halo-blur value in pixels
|
|
854
|
+
*/
|
|
855
|
+
textHaloBlur(value) {
|
|
856
|
+
this.addStyle("text-halo-blur", value);
|
|
857
|
+
return this;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
|
|
861
|
+
*
|
|
862
|
+
* @param value - text-translate value in pixels (default `0,0`)
|
|
863
|
+
*/
|
|
864
|
+
textTranslate(value) {
|
|
865
|
+
this.addStyle("text-translate", value);
|
|
866
|
+
return this;
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Controls the frame of reference for `text-translate`.
|
|
870
|
+
*
|
|
871
|
+
* Values:
|
|
872
|
+
* - map: The text is translated relative to the map.
|
|
873
|
+
* - viewport: The text is translated relative to the viewport.
|
|
874
|
+
*
|
|
875
|
+
* @param value - text-translate-anchor value (default `map`)
|
|
876
|
+
*/
|
|
877
|
+
textTranslateAnchor(value) {
|
|
878
|
+
this.addStyle("text-translate-anchor", value);
|
|
879
|
+
return this;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
MapLayerStyleBuilder.registerStyleBuilder("symbol", SymbolLayerStyleBuilder);
|
|
883
|
+
class CircleLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
884
|
+
/**
|
|
885
|
+
* Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.
|
|
886
|
+
*
|
|
887
|
+
* @param value - circle-sort-key value
|
|
888
|
+
*/
|
|
889
|
+
circleSortKey(value) {
|
|
890
|
+
this.addStyle("circle-sort-key", value);
|
|
891
|
+
return this;
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Circle radius.
|
|
895
|
+
*
|
|
896
|
+
* @param value - circle-radius value in pixels (default `5`)
|
|
897
|
+
*/
|
|
898
|
+
circleRadius(value) {
|
|
899
|
+
this.addStyle("circle-radius", value);
|
|
900
|
+
return this;
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* The fill color of the circle.
|
|
904
|
+
*
|
|
905
|
+
* @param value - circle-color value (default `#000000`)
|
|
906
|
+
*/
|
|
907
|
+
circleColor(value) {
|
|
908
|
+
this.addStyle("circle-color", value);
|
|
909
|
+
return this;
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
|
|
913
|
+
*
|
|
914
|
+
* @param value - circle-blur value
|
|
915
|
+
*/
|
|
916
|
+
circleBlur(value) {
|
|
917
|
+
this.addStyle("circle-blur", value);
|
|
918
|
+
return this;
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* The opacity at which the circle will be drawn.
|
|
922
|
+
*
|
|
923
|
+
* @param value - circle-opacity value (default `1`)
|
|
924
|
+
*/
|
|
925
|
+
circleOpacity(value) {
|
|
926
|
+
this.addStyle("circle-opacity", value);
|
|
927
|
+
return this;
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
|
|
931
|
+
*
|
|
932
|
+
* @param value - circle-translate value in pixels (default `0,0`)
|
|
933
|
+
*/
|
|
934
|
+
circleTranslate(value) {
|
|
935
|
+
this.addStyle("circle-translate", value);
|
|
936
|
+
return this;
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Controls the frame of reference for `circle-translate`.
|
|
940
|
+
*
|
|
941
|
+
* Values:
|
|
942
|
+
* - map: The circle is translated relative to the map.
|
|
943
|
+
* - viewport: The circle is translated relative to the viewport.
|
|
944
|
+
*
|
|
945
|
+
* @param value - circle-translate-anchor value (default `map`)
|
|
946
|
+
*/
|
|
947
|
+
circleTranslateAnchor(value) {
|
|
948
|
+
this.addStyle("circle-translate-anchor", value);
|
|
949
|
+
return this;
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* Controls the scaling behavior of the circle when the map is pitched.
|
|
953
|
+
*
|
|
954
|
+
* Values:
|
|
955
|
+
* - map: Circles are scaled according to their apparent distance to the camera.
|
|
956
|
+
* - viewport: Circles are not scaled.
|
|
957
|
+
*
|
|
958
|
+
* @param value - circle-pitch-scale value (default `map`)
|
|
959
|
+
*/
|
|
960
|
+
circlePitchScale(value) {
|
|
961
|
+
this.addStyle("circle-pitch-scale", value);
|
|
962
|
+
return this;
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Orientation of circle when map is pitched.
|
|
966
|
+
*
|
|
967
|
+
* Values:
|
|
968
|
+
* - map: The circle is aligned to the plane of the map.
|
|
969
|
+
* - viewport: The circle is aligned to the plane of the viewport.
|
|
970
|
+
*
|
|
971
|
+
* @param value - circle-pitch-alignment value (default `viewport`)
|
|
972
|
+
*/
|
|
973
|
+
circlePitchAlignment(value) {
|
|
974
|
+
this.addStyle("circle-pitch-alignment", value);
|
|
975
|
+
return this;
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
978
|
+
* The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.
|
|
979
|
+
*
|
|
980
|
+
* @param value - circle-stroke-width value in pixels
|
|
981
|
+
*/
|
|
982
|
+
circleStrokeWidth(value) {
|
|
983
|
+
this.addStyle("circle-stroke-width", value);
|
|
984
|
+
return this;
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* The stroke color of the circle.
|
|
988
|
+
*
|
|
989
|
+
* @param value - circle-stroke-color value (default `#000000`)
|
|
990
|
+
*/
|
|
991
|
+
circleStrokeColor(value) {
|
|
992
|
+
this.addStyle("circle-stroke-color", value);
|
|
993
|
+
return this;
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* The opacity of the circle's stroke.
|
|
997
|
+
*
|
|
998
|
+
* @param value - circle-stroke-opacity value (default `1`)
|
|
999
|
+
*/
|
|
1000
|
+
circleStrokeOpacity(value) {
|
|
1001
|
+
this.addStyle("circle-stroke-opacity", value);
|
|
1002
|
+
return this;
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
MapLayerStyleBuilder.registerStyleBuilder("circle", CircleLayerStyleBuilder);
|
|
1006
|
+
class HeatmapLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
1007
|
+
/**
|
|
1008
|
+
* Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.
|
|
1009
|
+
*
|
|
1010
|
+
* @param value - heatmap-radius value in pixels (default `30`)
|
|
1011
|
+
*/
|
|
1012
|
+
heatmapRadius(value) {
|
|
1013
|
+
this.addStyle("heatmap-radius", value);
|
|
1014
|
+
return this;
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.
|
|
1018
|
+
*
|
|
1019
|
+
* @param value - heatmap-weight value (default `1`)
|
|
1020
|
+
*/
|
|
1021
|
+
heatmapWeight(value) {
|
|
1022
|
+
this.addStyle("heatmap-weight", value);
|
|
1023
|
+
return this;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.
|
|
1027
|
+
*
|
|
1028
|
+
* @param value - heatmap-intensity value (default `1`)
|
|
1029
|
+
*/
|
|
1030
|
+
heatmapIntensity(value) {
|
|
1031
|
+
this.addStyle("heatmap-intensity", value);
|
|
1032
|
+
return this;
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.
|
|
1036
|
+
*
|
|
1037
|
+
* @param value - heatmap-color value (default `interpolate,linear,heatmap-density,0,rgba(0, 0, 255, 0),0.1,royalblue,0.3,cyan,0.5,lime,0.7,yellow,1,red`)
|
|
1038
|
+
*/
|
|
1039
|
+
heatmapColor(value) {
|
|
1040
|
+
this.addStyle("heatmap-color", value);
|
|
1041
|
+
return this;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* The global opacity at which the heatmap layer will be drawn.
|
|
1045
|
+
*
|
|
1046
|
+
* @param value - heatmap-opacity value (default `1`)
|
|
1047
|
+
*/
|
|
1048
|
+
heatmapOpacity(value) {
|
|
1049
|
+
this.addStyle("heatmap-opacity", value);
|
|
1050
|
+
return this;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
MapLayerStyleBuilder.registerStyleBuilder("heatmap", HeatmapLayerStyleBuilder);
|
|
1054
|
+
class FillExtrusionLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
1055
|
+
/**
|
|
1056
|
+
* The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.
|
|
1057
|
+
*
|
|
1058
|
+
* @param value - fill-extrusion-opacity value (default `1`)
|
|
1059
|
+
*/
|
|
1060
|
+
fillExtrusionOpacity(value) {
|
|
1061
|
+
this.addStyle("fill-extrusion-opacity", value);
|
|
1062
|
+
return this;
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.
|
|
1066
|
+
*
|
|
1067
|
+
* @param value - fill-extrusion-color value (default `#000000`)
|
|
1068
|
+
*/
|
|
1069
|
+
fillExtrusionColor(value) {
|
|
1070
|
+
this.addStyle("fill-extrusion-color", value);
|
|
1071
|
+
return this;
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.
|
|
1075
|
+
*
|
|
1076
|
+
* @param value - fill-extrusion-translate value in pixels (default `0,0`)
|
|
1077
|
+
*/
|
|
1078
|
+
fillExtrusionTranslate(value) {
|
|
1079
|
+
this.addStyle("fill-extrusion-translate", value);
|
|
1080
|
+
return this;
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* Controls the frame of reference for `fill-extrusion-translate`.
|
|
1084
|
+
*
|
|
1085
|
+
* Values:
|
|
1086
|
+
* - map: The fill extrusion is translated relative to the map.
|
|
1087
|
+
* - viewport: The fill extrusion is translated relative to the viewport.
|
|
1088
|
+
*
|
|
1089
|
+
* @param value - fill-extrusion-translate-anchor value (default `map`)
|
|
1090
|
+
*/
|
|
1091
|
+
fillExtrusionTranslateAnchor(value) {
|
|
1092
|
+
this.addStyle("fill-extrusion-translate-anchor", value);
|
|
1093
|
+
return this;
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
|
|
1097
|
+
*
|
|
1098
|
+
* @param value - fill-extrusion-pattern value
|
|
1099
|
+
*/
|
|
1100
|
+
fillExtrusionPattern(value) {
|
|
1101
|
+
this.addStyle("fill-extrusion-pattern", value);
|
|
1102
|
+
return this;
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* The height with which to extrude this layer.
|
|
1106
|
+
*
|
|
1107
|
+
* @param value - fill-extrusion-height value in meters
|
|
1108
|
+
*/
|
|
1109
|
+
fillExtrusionHeight(value) {
|
|
1110
|
+
this.addStyle("fill-extrusion-height", value);
|
|
1111
|
+
return this;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.
|
|
1115
|
+
*
|
|
1116
|
+
* @param value - fill-extrusion-base value in meters
|
|
1117
|
+
*/
|
|
1118
|
+
fillExtrusionBase(value) {
|
|
1119
|
+
this.addStyle("fill-extrusion-base", value);
|
|
1120
|
+
return this;
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.
|
|
1124
|
+
*
|
|
1125
|
+
* @param value - fill-extrusion-vertical-gradient value (default `true`)
|
|
1126
|
+
*/
|
|
1127
|
+
fillExtrusionVerticalGradient(value) {
|
|
1128
|
+
this.addStyle("fill-extrusion-vertical-gradient", value);
|
|
1129
|
+
return this;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
MapLayerStyleBuilder.registerStyleBuilder("fill-extrusion", FillExtrusionLayerStyleBuilder);
|
|
1133
|
+
class RasterLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
1134
|
+
/**
|
|
1135
|
+
* The opacity at which the image will be drawn.
|
|
1136
|
+
*
|
|
1137
|
+
* @param value - raster-opacity value (default `1`)
|
|
1138
|
+
*/
|
|
1139
|
+
rasterOpacity(value) {
|
|
1140
|
+
this.addStyle("raster-opacity", value);
|
|
1141
|
+
return this;
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
* Rotates hues around the color wheel.
|
|
1145
|
+
*
|
|
1146
|
+
* @param value - raster-hue-rotate value in degrees
|
|
1147
|
+
*/
|
|
1148
|
+
rasterHueRotate(value) {
|
|
1149
|
+
this.addStyle("raster-hue-rotate", value);
|
|
1150
|
+
return this;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* Increase or reduce the brightness of the image. The value is the minimum brightness.
|
|
1154
|
+
*
|
|
1155
|
+
* @param value - raster-brightness-min value
|
|
1156
|
+
*/
|
|
1157
|
+
rasterBrightnessMin(value) {
|
|
1158
|
+
this.addStyle("raster-brightness-min", value);
|
|
1159
|
+
return this;
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Increase or reduce the brightness of the image. The value is the maximum brightness.
|
|
1163
|
+
*
|
|
1164
|
+
* @param value - raster-brightness-max value (default `1`)
|
|
1165
|
+
*/
|
|
1166
|
+
rasterBrightnessMax(value) {
|
|
1167
|
+
this.addStyle("raster-brightness-max", value);
|
|
1168
|
+
return this;
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* Increase or reduce the saturation of the image.
|
|
1172
|
+
*
|
|
1173
|
+
* @param value - raster-saturation value
|
|
1174
|
+
*/
|
|
1175
|
+
rasterSaturation(value) {
|
|
1176
|
+
this.addStyle("raster-saturation", value);
|
|
1177
|
+
return this;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Increase or reduce the contrast of the image.
|
|
1181
|
+
*
|
|
1182
|
+
* @param value - raster-contrast value
|
|
1183
|
+
*/
|
|
1184
|
+
rasterContrast(value) {
|
|
1185
|
+
this.addStyle("raster-contrast", value);
|
|
1186
|
+
return this;
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* The resampling/interpolation method to use for overscaling, also known as texture magnification filter
|
|
1190
|
+
*
|
|
1191
|
+
* Values:
|
|
1192
|
+
* - linear: (Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled
|
|
1193
|
+
* - nearest: Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled
|
|
1194
|
+
*
|
|
1195
|
+
* @param value - raster-resampling value (default `linear`)
|
|
1196
|
+
*/
|
|
1197
|
+
rasterResampling(value) {
|
|
1198
|
+
this.addStyle("raster-resampling", value);
|
|
1199
|
+
return this;
|
|
1200
|
+
}
|
|
1201
|
+
/**
|
|
1202
|
+
* Fade duration when a new tile is added.
|
|
1203
|
+
*
|
|
1204
|
+
* @param value - raster-fade-duration value in milliseconds (default `300`)
|
|
1205
|
+
*/
|
|
1206
|
+
rasterFadeDuration(value) {
|
|
1207
|
+
this.addStyle("raster-fade-duration", value);
|
|
1208
|
+
return this;
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
MapLayerStyleBuilder.registerStyleBuilder("raster", RasterLayerStyleBuilder);
|
|
1212
|
+
class HillshadeLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
1213
|
+
/**
|
|
1214
|
+
* The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.
|
|
1215
|
+
*
|
|
1216
|
+
* @param value - hillshade-illumination-direction value (default `335`)
|
|
1217
|
+
*/
|
|
1218
|
+
hillshadeIlluminationDirection(value) {
|
|
1219
|
+
this.addStyle("hillshade-illumination-direction", value);
|
|
1220
|
+
return this;
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Direction of light source when map is rotated.
|
|
1224
|
+
*
|
|
1225
|
+
* Values:
|
|
1226
|
+
* - map: The hillshade illumination is relative to the north direction.
|
|
1227
|
+
* - viewport: The hillshade illumination is relative to the top of the viewport.
|
|
1228
|
+
*
|
|
1229
|
+
* @param value - hillshade-illumination-anchor value (default `viewport`)
|
|
1230
|
+
*/
|
|
1231
|
+
hillshadeIlluminationAnchor(value) {
|
|
1232
|
+
this.addStyle("hillshade-illumination-anchor", value);
|
|
1233
|
+
return this;
|
|
1234
|
+
}
|
|
1235
|
+
/**
|
|
1236
|
+
* Intensity of the hillshade
|
|
1237
|
+
*
|
|
1238
|
+
* @param value - hillshade-exaggeration value (default `0.5`)
|
|
1239
|
+
*/
|
|
1240
|
+
hillshadeExaggeration(value) {
|
|
1241
|
+
this.addStyle("hillshade-exaggeration", value);
|
|
1242
|
+
return this;
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* The shading color of areas that face away from the light source.
|
|
1246
|
+
*
|
|
1247
|
+
* @param value - hillshade-shadow-color value (default `#000000`)
|
|
1248
|
+
*/
|
|
1249
|
+
hillshadeShadowColor(value) {
|
|
1250
|
+
this.addStyle("hillshade-shadow-color", value);
|
|
1251
|
+
return this;
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* The shading color of areas that faces towards the light source.
|
|
1255
|
+
*
|
|
1256
|
+
* @param value - hillshade-highlight-color value (default `#FFFFFF`)
|
|
1257
|
+
*/
|
|
1258
|
+
hillshadeHighlightColor(value) {
|
|
1259
|
+
this.addStyle("hillshade-highlight-color", value);
|
|
1260
|
+
return this;
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* The shading color used to accentuate rugged terrain like sharp cliffs and gorges.
|
|
1264
|
+
*
|
|
1265
|
+
* @param value - hillshade-accent-color value (default `#000000`)
|
|
1266
|
+
*/
|
|
1267
|
+
hillshadeAccentColor(value) {
|
|
1268
|
+
this.addStyle("hillshade-accent-color", value);
|
|
1269
|
+
return this;
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
MapLayerStyleBuilder.registerStyleBuilder("hillshade", HillshadeLayerStyleBuilder);
|
|
1273
|
+
class BackgroundLayerStyleBuilder extends MapLayerStyleBuilder {
|
|
1274
|
+
/**
|
|
1275
|
+
* The color with which the background will be drawn.
|
|
1276
|
+
*
|
|
1277
|
+
* @param value - background-color value (default `#000000`)
|
|
1278
|
+
*/
|
|
1279
|
+
backgroundColor(value) {
|
|
1280
|
+
this.addStyle("background-color", value);
|
|
1281
|
+
return this;
|
|
1282
|
+
}
|
|
1283
|
+
/**
|
|
1284
|
+
* Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.
|
|
1285
|
+
*
|
|
1286
|
+
* @param value - background-pattern value
|
|
1287
|
+
*/
|
|
1288
|
+
backgroundPattern(value) {
|
|
1289
|
+
this.addStyle("background-pattern", value);
|
|
1290
|
+
return this;
|
|
1291
|
+
}
|
|
1292
|
+
/**
|
|
1293
|
+
* The opacity at which the background will be drawn.
|
|
1294
|
+
*
|
|
1295
|
+
* @param value - background-opacity value (default `1`)
|
|
1296
|
+
*/
|
|
1297
|
+
backgroundOpacity(value) {
|
|
1298
|
+
this.addStyle("background-opacity", value);
|
|
1299
|
+
return this;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
MapLayerStyleBuilder.registerStyleBuilder("background", BackgroundLayerStyleBuilder);
|
|
1303
|
+
function layerStyle(layerType) {
|
|
1304
|
+
return MapLayerStyleBuilder.createStyleBuilder(layerType);
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
export { BackgroundLayerStyleBuilder, CircleLayerStyleBuilder, FillExtrusionLayerStyleBuilder, FillLayerStyleBuilder, HeatmapLayerStyleBuilder, HillshadeLayerStyleBuilder, LineLayerStyleBuilder, RasterLayerStyleBuilder, SymbolLayerStyleBuilder, layerStyle };
|