@versatiles/svg-renderer 2.4.1 → 2.5.0

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +136 -61
  2. package/dist/index.js +128 -68
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  /// <reference types="geojson" />
2
- //#endregion
3
- //#region src/types.g.d.ts
4
2
  type ColorSpecification = string;
5
3
  type ProjectionDefinitionT = [string, string, number];
6
4
  type ProjectionDefinitionSpecification = string | ProjectionDefinitionT | PropertyValueSpecification<ProjectionDefinitionT>;
@@ -206,7 +204,7 @@ type StyleSpecification = {
206
204
  */
207
205
  "roll"?: number;
208
206
  /**
209
- * An object used to define default values when using the [`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression.
207
+ * An object used to define default values when using the [`global-state`](expressions/#global-state) expression.
210
208
  *
211
209
  * @default
212
210
  * ```json
@@ -289,7 +287,7 @@ type StyleSpecification = {
289
287
  /**
290
288
  * Sources state which data the map should display. Specify the type of source with the `type` property. Adding a source isn't enough to make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer.
291
289
  *
292
- * Tiled sources (vector and raster) must specify their details according to the [TileJSON specification](https://github.com/mapbox/tilejson-spec).
290
+ * Tiled sources (vector and raster) must specify their details according to [TileJSON](tilejson.md).
293
291
  *
294
292
  * @example
295
293
  * ```json
@@ -335,7 +333,7 @@ type StyleSpecification = {
335
333
  /**
336
334
  * A URL template for loading signed-distance-field glyph sets in PBF format.
337
335
  *
338
- * If this property is set, any text in the `text-field` layout property is displayed in the font stack named by the `text-font` layout property based on glyphs located at the URL specified by this property. Otherwise, font faces will be determined by the `text-font` property based on the local environment.
336
+ * If this property is set, any text in the [`text-field`](layers/#text-field) layout property is displayed in the font stack named by the [`text-font`](layers/#text-font) layout property based on glyphs located at the URL specified by this property. Otherwise, font faces will be determined by the `text-font` property based on the local environment.
339
337
  *
340
338
  * The URL must include:
341
339
  *
@@ -578,7 +576,19 @@ type VectorSourceSpecification = {
578
576
  */
579
577
  "url"?: string;
580
578
  /**
581
- * An array of one or more tile source URLs, as in the TileJSON spec.
579
+ * An array of one or more tile source URLs, as in the TileJSON spec. These tokens in a URL are replaced for each tile:
580
+ *
581
+ * - `{z}`, `{x}` and `{y}` - The tile's zoom level, column and row. With `scheme` set to `tms`, the row counts from the bottom.
582
+ *
583
+ * - `{quadkey}` - The tile's quadkey, as Bing Maps addresses tiles.
584
+ *
585
+ * - `{bbox-epsg-3857}` - The tile's bounding box in EPSG:3857 meters, as `minX,minY,maxX,maxY`, for WMS requests.
586
+ *
587
+ * - `{bbox}` - Experimental. The tile's bounding box as `minX,minY,maxX,maxY` in the units of the map's coordinate system. With the `mercator`, `globe` and `vertical-perspective` projections this is the same as `{bbox-epsg-3857}`.
588
+ *
589
+ * - `{prefix}` - Two hexadecimal digits from the tile's column and row, to spread requests over host names.
590
+ *
591
+ * - `{ratio}` - `@2x` where the device pixel ratio is above 1, empty otherwise.
582
592
  */
583
593
  "tiles"?: Array<string>;
584
594
  /**
@@ -599,6 +609,15 @@ type VectorSourceSpecification = {
599
609
  * ```
600
610
  */
601
611
  "scheme"?: "xyz" | "tms";
612
+ /**
613
+ * Experimental. What an empty tile response (HTTP 204, or no tile data from an archive such as PMTiles) means in this tileset.
614
+ *
615
+ * @default
616
+ * ```json
617
+ * "blank"
618
+ * ```
619
+ */
620
+ "emptyResponse"?: "blank" | "missing";
602
621
  /**
603
622
  * Minimum zoom level for which tiles are available, as in the TileJSON spec.
604
623
  */
@@ -644,7 +663,19 @@ type RasterSourceSpecification = {
644
663
  */
645
664
  "url"?: string;
646
665
  /**
647
- * An array of one or more tile source URLs, as in the TileJSON spec.
666
+ * An array of one or more tile source URLs, as in the TileJSON spec. These tokens in a URL are replaced for each tile:
667
+ *
668
+ * - `{z}`, `{x}` and `{y}` - The tile's zoom level, column and row. With `scheme` set to `tms`, the row counts from the bottom.
669
+ *
670
+ * - `{quadkey}` - The tile's quadkey, as Bing Maps addresses tiles.
671
+ *
672
+ * - `{bbox-epsg-3857}` - The tile's bounding box in EPSG:3857 meters, as `minX,minY,maxX,maxY`, for WMS requests.
673
+ *
674
+ * - `{bbox}` - Experimental. The tile's bounding box as `minX,minY,maxX,maxY` in the units of the map's coordinate system. With the `mercator`, `globe` and `vertical-perspective` projections this is the same as `{bbox-epsg-3857}`.
675
+ *
676
+ * - `{prefix}` - Two hexadecimal digits from the tile's column and row, to spread requests over host names.
677
+ *
678
+ * - `{ratio}` - `@2x` where the device pixel ratio is above 1, empty otherwise.
648
679
  */
649
680
  "tiles"?: Array<string>;
650
681
  /**
@@ -670,7 +701,7 @@ type RasterSourceSpecification = {
670
701
  */
671
702
  "maxzoom"?: number;
672
703
  /**
673
- * The minimum visual size to display tiles for this layer. Only configurable for raster layers.
704
+ * The minimum visual size to display tiles for this source.
674
705
  *
675
706
  * @default
676
707
  * ```json
@@ -687,6 +718,15 @@ type RasterSourceSpecification = {
687
718
  * ```
688
719
  */
689
720
  "scheme"?: "xyz" | "tms";
721
+ /**
722
+ * Experimental. What an empty tile response (HTTP 204, or no tile data from an archive such as PMTiles) means in this tileset.
723
+ *
724
+ * @default
725
+ * ```json
726
+ * "blank"
727
+ * ```
728
+ */
729
+ "emptyResponse"?: "blank" | "missing";
690
730
  /**
691
731
  * Contains an attribution to be displayed when the map is shown to a user.
692
732
  */
@@ -706,7 +746,19 @@ type RasterDEMSourceSpecification = {
706
746
  */
707
747
  "url"?: string;
708
748
  /**
709
- * An array of one or more tile source URLs, as in the TileJSON spec.
749
+ * An array of one or more tile source URLs, as in the TileJSON spec. These tokens in a URL are replaced for each tile:
750
+ *
751
+ * - `{z}`, `{x}` and `{y}` - The tile's zoom level, column and row.
752
+ *
753
+ * - `{quadkey}` - The tile's quadkey, as Bing Maps addresses tiles.
754
+ *
755
+ * - `{bbox-epsg-3857}` - The tile's bounding box in EPSG:3857 meters, as `minX,minY,maxX,maxY`, for WMS requests.
756
+ *
757
+ * - `{bbox}` - Experimental. The tile's bounding box as `minX,minY,maxX,maxY` in the units of the map's coordinate system. With the `mercator`, `globe` and `vertical-perspective` projections this is the same as `{bbox-epsg-3857}`.
758
+ *
759
+ * - `{prefix}` - Two hexadecimal digits from the tile's column and row, to spread requests over host names.
760
+ *
761
+ * - `{ratio}` - `@2x` where the device pixel ratio is above 1, empty otherwise.
710
762
  */
711
763
  "tiles"?: Array<string>;
712
764
  /**
@@ -732,7 +784,7 @@ type RasterDEMSourceSpecification = {
732
784
  */
733
785
  "maxzoom"?: number;
734
786
  /**
735
- * The minimum visual size to display tiles for this layer. Only configurable for raster layers.
787
+ * The minimum visual size to display tiles for this source.
736
788
  *
737
789
  * @default
738
790
  * ```json
@@ -740,6 +792,15 @@ type RasterDEMSourceSpecification = {
740
792
  * ```
741
793
  */
742
794
  "tileSize"?: number;
795
+ /**
796
+ * Experimental. What an empty tile response (HTTP 204, or no tile data from an archive such as PMTiles) means in this tileset.
797
+ *
798
+ * @default
799
+ * ```json
800
+ * "blank"
801
+ * ```
802
+ */
803
+ "emptyResponse"?: "blank" | "missing";
743
804
  /**
744
805
  * Contains an attribution to be displayed when the map is shown to a user.
745
806
  */
@@ -873,7 +934,7 @@ type GeoJSONSourceSpecification = {
873
934
  */
874
935
  "clusterProperties"?: unknown;
875
936
  /**
876
- * Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values.
937
+ * Whether to calculate line distance metrics. This is required for line layers that specify [`line-gradient`](layers/#line-gradient) values.
877
938
  */
878
939
  "lineMetrics"?: boolean;
879
940
  /**
@@ -946,7 +1007,7 @@ type FillLayerSpecification = {
946
1007
  */
947
1008
  "maxzoom"?: number;
948
1009
  /**
949
- * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
1010
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The [`feature-state`](expressions/#feature-state) expression is not supported in filter expressions.
950
1011
  */
951
1012
  "filter"?: FilterSpecification;
952
1013
  /**
@@ -981,7 +1042,7 @@ type FillLayerSpecification = {
981
1042
  */
982
1043
  "fill-antialias"?: PropertyValueSpecification<boolean>;
983
1044
  /**
984
- * 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.
1045
+ * The opacity of the entire fill layer. In contrast to the [`fill-color`](layers/#fill-color), this value will also affect the 1px stroke around the fill, if the stroke is used.
985
1046
  *
986
1047
  * @default
987
1048
  * ```json
@@ -991,7 +1052,7 @@ type FillLayerSpecification = {
991
1052
  "fill-opacity"?: DataDrivenPropertyValueSpecification<number>;
992
1053
  "fill-opacity-transition"?: TransitionSpecification;
993
1054
  /**
994
- * Opacity applied to the layer as a whole. Unlike `fill-opacity` and alpha values in `fill-color`, which are applied per feature and accumulate where fills overlap, `fill-layer-opacity` is applied once so overlapping fills appear as a single surface at the given opacity. When both `fill-opacity` and `fill-layer-opacity` are set, the per-feature, overlap accumulation is preserved, then `fill-layer-opacity` composites the result. This property affects only the layer it is set on and cannot be used to composite multiple layers together or control how this layer blends with layers above or below it.
1055
+ * Opacity applied to the layer as a whole. Unlike [`fill-opacity`](layers/#fill-opacity) and alpha values in [`fill-color`](layers/#fill-color), which are applied per feature and accumulate where fills overlap, `fill-layer-opacity` is applied once so overlapping fills appear as a single surface at the given opacity. When both `fill-opacity` and `fill-layer-opacity` are set, the per-feature, overlap accumulation is preserved, then `fill-layer-opacity` composites the result. This property affects only the layer it is set on and cannot be used to composite multiple layers together or control how this layer blends with layers above or below it.
995
1056
  *
996
1057
  * ![fill-opacity vs. fill-layer-opacity](assets/fill-layer-opacity.svg)
997
1058
  *
@@ -1002,6 +1063,17 @@ type FillLayerSpecification = {
1002
1063
  */
1003
1064
  "fill-layer-opacity"?: PropertyValueSpecification<number>;
1004
1065
  "fill-layer-opacity-transition"?: TransitionSpecification;
1066
+ /**
1067
+ * Controls how the layer is composited with the content already rendered beneath it. Unlike per-feature opacity properties such as `fill-opacity`, this property affects the final composited layer output and determines how it interacts with the existing map contents.
1068
+ *
1069
+ * ![fill-layer-blend examples](assets/fill-layer-blend.svg)
1070
+ *
1071
+ * @default
1072
+ * ```json
1073
+ * "normal"
1074
+ * ```
1075
+ */
1076
+ "fill-layer-blend"?: "normal" | "multiply" | "color" | "luminosity" | "plus-lighter" | "screen" | "overlay";
1005
1077
  /**
1006
1078
  * 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. When used with an SDF fill pattern, this serves as the foreground color of the pattern.
1007
1079
  *
@@ -1013,7 +1085,7 @@ type FillLayerSpecification = {
1013
1085
  "fill-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1014
1086
  "fill-color-transition"?: TransitionSpecification;
1015
1087
  /**
1016
- * The outline color of the fill. Matches the value of `fill-color` if unspecified.
1088
+ * The outline color of the fill. Matches the value of [`fill-color`](layers/#fill-color) if unspecified.
1017
1089
  */
1018
1090
  "fill-outline-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1019
1091
  "fill-outline-color-transition"?: TransitionSpecification;
@@ -1028,7 +1100,7 @@ type FillLayerSpecification = {
1028
1100
  "fill-translate"?: PropertyValueSpecification<[number, number]>;
1029
1101
  "fill-translate-transition"?: TransitionSpecification;
1030
1102
  /**
1031
- * Controls the frame of reference for `fill-translate`.
1103
+ * Controls the frame of reference for [`fill-translate`](layers/#fill-translate).
1032
1104
  *
1033
1105
  * @default
1034
1106
  * ```json
@@ -1075,7 +1147,7 @@ type LineLayerSpecification = {
1075
1147
  */
1076
1148
  "maxzoom"?: number;
1077
1149
  /**
1078
- * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
1150
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The [`feature-state`](expressions/#feature-state) expression is not supported in filter expressions.
1079
1151
  */
1080
1152
  "filter"?: FilterSpecification;
1081
1153
  /**
@@ -1147,7 +1219,7 @@ type LineLayerSpecification = {
1147
1219
  "line-opacity"?: DataDrivenPropertyValueSpecification<number>;
1148
1220
  "line-opacity-transition"?: TransitionSpecification;
1149
1221
  /**
1150
- * Opacity applied to the layer as a whole. Unlike `line-opacity` and alpha values in `line-color`, which are applied per feature and accumulate where lines overlap, `line-layer-opacity` is applied once so overlapping lines appear as a single surface at the given opacity. When both `line-opacity` and `line-layer-opacity` are set, the per-feature, overlap accumulation is preserved, then layer-opacity composites the result. This property affects only the layer it is set on and cannot be used to composite multiple layers together or control how this layer blends with layers above or below it.
1222
+ * Opacity applied to the layer as a whole. Unlike [`line-opacity`](layers/#line-opacity) and alpha values in [`line-color`](layers/#line-color), which are applied per feature and accumulate where lines overlap, `line-layer-opacity` is applied once so overlapping lines appear as a single surface at the given opacity. When both `line-opacity` and `line-layer-opacity` are set, the per-feature, overlap accumulation is preserved, then layer-opacity composites the result. This property affects only the layer it is set on and cannot be used to composite multiple layers together or control how this layer blends with layers above or below it.
1151
1223
  *
1152
1224
  * ![line-opacity vs. line-layer-opacity](assets/line-layer-opacity.svg)
1153
1225
  *
@@ -1158,6 +1230,17 @@ type LineLayerSpecification = {
1158
1230
  */
1159
1231
  "line-layer-opacity"?: PropertyValueSpecification<number>;
1160
1232
  "line-layer-opacity-transition"?: TransitionSpecification;
1233
+ /**
1234
+ * Controls how the layer is composited with the content already rendered beneath it. Unlike per-feature opacity properties such as [`line-opacity`](#line-opacity), this property affects the final composited layer output and determines how it interacts with the existing map contents.
1235
+ *
1236
+ * ![line-layer-blend examples](assets/line-layer-blend.svg)
1237
+ *
1238
+ * @default
1239
+ * ```json
1240
+ * "normal"
1241
+ * ```
1242
+ */
1243
+ "line-layer-blend"?: "normal" | "multiply" | "color" | "luminosity" | "plus-lighter" | "screen" | "overlay";
1161
1244
  /**
1162
1245
  * The color with which the line will be drawn.
1163
1246
  *
@@ -1179,7 +1262,7 @@ type LineLayerSpecification = {
1179
1262
  "line-translate"?: PropertyValueSpecification<[number, number]>;
1180
1263
  "line-translate-transition"?: TransitionSpecification;
1181
1264
  /**
1182
- * Controls the frame of reference for `line-translate`.
1265
+ * Controls the frame of reference for [`line-translate`](layers/#line-translate).
1183
1266
  *
1184
1267
  * @default
1185
1268
  * ```json
@@ -1260,7 +1343,7 @@ type SymbolLayerSpecification = {
1260
1343
  */
1261
1344
  "maxzoom"?: number;
1262
1345
  /**
1263
- * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
1346
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The [`feature-state`](expressions/#feature-state) expression is not supported in filter expressions.
1264
1347
  */
1265
1348
  "filter"?: FilterSpecification;
1266
1349
  /**
@@ -1290,11 +1373,11 @@ type SymbolLayerSpecification = {
1290
1373
  */
1291
1374
  "symbol-avoid-edges"?: PropertyValueSpecification<boolean>;
1292
1375
  /**
1293
- * 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.
1376
+ * Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When [`icon-allow-overlap`](layers/#icon-allow-overlap) or [`text-allow-overlap`](layers/#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.
1294
1377
  */
1295
1378
  "symbol-sort-key"?: DataDrivenPropertyValueSpecification<number>;
1296
1379
  /**
1297
- * 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`.
1380
+ * 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`](layers/#symbol-sort-key).
1298
1381
  *
1299
1382
  * @default
1300
1383
  * ```json
@@ -1307,7 +1390,7 @@ type SymbolLayerSpecification = {
1307
1390
  */
1308
1391
  "icon-allow-overlap"?: PropertyValueSpecification<boolean>;
1309
1392
  /**
1310
- * 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.
1393
+ * 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`](layers/#icon-allow-overlap) is used instead.
1311
1394
  */
1312
1395
  "icon-overlap"?: PropertyValueSpecification<"never" | "always" | "cooperative">;
1313
1396
  /**
@@ -1319,7 +1402,7 @@ type SymbolLayerSpecification = {
1319
1402
  */
1320
1403
  "icon-optional"?: PropertyValueSpecification<boolean>;
1321
1404
  /**
1322
- * In combination with `symbol-placement`, determines the rotation behavior of icons.
1405
+ * In combination with [`symbol-placement`](layers/#symbol-placement), determines the rotation behavior of icons.
1323
1406
  *
1324
1407
  * @default
1325
1408
  * ```json
@@ -1346,7 +1429,7 @@ type SymbolLayerSpecification = {
1346
1429
  */
1347
1430
  "icon-text-fit"?: PropertyValueSpecification<"none" | "width" | "height" | "both">;
1348
1431
  /**
1349
- * Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.
1432
+ * Size of the additional area added to dimensions determined by [`icon-text-fit`](layers/#icon-text-fit), in clockwise order: top, right, bottom, left.
1350
1433
  *
1351
1434
  * @default
1352
1435
  * ```json
@@ -1376,7 +1459,7 @@ type SymbolLayerSpecification = {
1376
1459
  */
1377
1460
  "icon-keep-upright"?: PropertyValueSpecification<boolean>;
1378
1461
  /**
1379
- * 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.
1462
+ * 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`](layers/#icon-size) to obtain the final offset in pixels. When combined with [`icon-rotate`](layers/#icon-rotate) the offset will be as if the rotated direction was up.
1380
1463
  *
1381
1464
  * @default
1382
1465
  * ```json
@@ -1412,7 +1495,7 @@ type SymbolLayerSpecification = {
1412
1495
  */
1413
1496
  "text-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
1414
1497
  /**
1415
- * In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
1498
+ * In combination with [`symbol-placement`](layers/#symbol-placement), determines the rotation behavior of the individual glyphs forming the text.
1416
1499
  *
1417
1500
  * @default
1418
1501
  * ```json
@@ -1474,11 +1557,11 @@ type SymbolLayerSpecification = {
1474
1557
  */
1475
1558
  "text-justify"?: DataDrivenPropertyValueSpecification<"auto" | "left" | "center" | "right">;
1476
1559
  /**
1477
- * 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.
1560
+ * Radial offset of text, in the direction of the symbol's anchor. Useful in combination with [`text-variable-anchor`](layers/#text-variable-anchor), which defaults to using the two-dimensional [`text-offset`](layers/#text-offset) if present.
1478
1561
  */
1479
1562
  "text-radial-offset"?: DataDrivenPropertyValueSpecification<number>;
1480
1563
  /**
1481
- * 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`.
1564
+ * To increase the chance of placing high-priority labels on the map, you can provide an array of [`text-anchor`](layers/#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`](layers/#text-radial-offset) or the two-dimensional [`text-offset`](layers/#text-offset).
1482
1565
  *
1483
1566
  * @example
1484
1567
  * ```json
@@ -1487,11 +1570,11 @@ type SymbolLayerSpecification = {
1487
1570
  */
1488
1571
  "text-variable-anchor"?: PropertyValueSpecification<Array<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">>;
1489
1572
  /**
1490
- * 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.
1573
+ * To increase the chance of placing high-priority labels on the map, you can provide an array of [`text-anchor`](layers/#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.
1491
1574
  *
1492
1575
  * 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.
1493
1576
  *
1494
- * When present, this property takes precedence over `text-anchor`, `text-variable-anchor`, `text-offset`, and `text-radial-offset`.
1577
+ * When present, this property takes precedence over `text-anchor`, [`text-variable-anchor`](layers/#text-variable-anchor), [`text-offset`](layers/#text-offset), and [`text-radial-offset`](layers/#text-radial-offset).
1495
1578
  *
1496
1579
  * ```json
1497
1580
  *
@@ -1576,7 +1659,7 @@ type SymbolLayerSpecification = {
1576
1659
  */
1577
1660
  "text-allow-overlap"?: PropertyValueSpecification<boolean>;
1578
1661
  /**
1579
- * 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
1662
+ * 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`](layers/#text-allow-overlap) is used instead
1580
1663
  */
1581
1664
  "text-overlap"?: PropertyValueSpecification<"never" | "always" | "cooperative">;
1582
1665
  /**
@@ -1588,11 +1671,11 @@ type SymbolLayerSpecification = {
1588
1671
  */
1589
1672
  "text-optional"?: PropertyValueSpecification<boolean>;
1590
1673
  /**
1591
- * The height above the anchor, in meters, at which the symbol is placed. Use `symbol-height-anchor` to control what this height is measured from.
1674
+ * The height above the anchor, in meters, at which the symbol is placed. Use [`symbol-height-anchor`](layers/#symbol-height-anchor) to control what this height is measured from.
1592
1675
  */
1593
1676
  "symbol-height-offset"?: DataDrivenPropertyValueSpecification<number>;
1594
1677
  /**
1595
- * Defines what `symbol-height-offset` is measured from.
1678
+ * Defines what [`symbol-height-offset`](layers/#symbol-height-offset) is measured from.
1596
1679
  *
1597
1680
  * @default
1598
1681
  * ```json
@@ -1667,7 +1750,7 @@ type SymbolLayerSpecification = {
1667
1750
  "icon-translate"?: PropertyValueSpecification<[number, number]>;
1668
1751
  "icon-translate-transition"?: TransitionSpecification;
1669
1752
  /**
1670
- * Controls the frame of reference for `icon-translate`.
1753
+ * Controls the frame of reference for [`icon-translate`](layers/#icon-translate).
1671
1754
  *
1672
1755
  * @default
1673
1756
  * ```json
@@ -1726,7 +1809,7 @@ type SymbolLayerSpecification = {
1726
1809
  "text-translate"?: PropertyValueSpecification<[number, number]>;
1727
1810
  "text-translate-transition"?: TransitionSpecification;
1728
1811
  /**
1729
- * Controls the frame of reference for `text-translate`.
1812
+ * Controls the frame of reference for [`text-translate`](layers/#text-translate).
1730
1813
  *
1731
1814
  * @default
1732
1815
  * ```json
@@ -1768,7 +1851,7 @@ type CircleLayerSpecification = {
1768
1851
  */
1769
1852
  "maxzoom"?: number;
1770
1853
  /**
1771
- * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
1854
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The [`feature-state`](expressions/#feature-state) expression is not supported in filter expressions.
1772
1855
  */
1773
1856
  "filter"?: FilterSpecification;
1774
1857
  /**
@@ -1839,7 +1922,7 @@ type CircleLayerSpecification = {
1839
1922
  "circle-translate"?: PropertyValueSpecification<[number, number]>;
1840
1923
  "circle-translate-transition"?: TransitionSpecification;
1841
1924
  /**
1842
- * Controls the frame of reference for `circle-translate`.
1925
+ * Controls the frame of reference for [`circle-translate`](layers/#circle-translate).
1843
1926
  *
1844
1927
  * @default
1845
1928
  * ```json
@@ -1866,7 +1949,7 @@ type CircleLayerSpecification = {
1866
1949
  */
1867
1950
  "circle-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport">;
1868
1951
  /**
1869
- * The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.
1952
+ * The width of the circle's stroke. Strokes are placed outside of the [`circle-radius`](layers/#circle-radius).
1870
1953
  */
1871
1954
  "circle-stroke-width"?: DataDrivenPropertyValueSpecification<number>;
1872
1955
  "circle-stroke-width-transition"?: TransitionSpecification;
@@ -1924,7 +2007,7 @@ type HeatmapLayerSpecification = {
1924
2007
  */
1925
2008
  "maxzoom"?: number;
1926
2009
  /**
1927
- * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
2010
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The [`feature-state`](expressions/#feature-state) expression is not supported in filter expressions.
1928
2011
  */
1929
2012
  "filter"?: FilterSpecification;
1930
2013
  /**
@@ -1965,7 +2048,7 @@ type HeatmapLayerSpecification = {
1965
2048
  */
1966
2049
  "heatmap-weight"?: DataDrivenPropertyValueSpecification<number>;
1967
2050
  /**
1968
- * Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.
2051
+ * Similar to [`heatmap-weight`](layers/#heatmap-weight) but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.
1969
2052
  *
1970
2053
  * @default
1971
2054
  * ```json
@@ -2043,7 +2126,7 @@ type FillExtrusionLayerSpecification = {
2043
2126
  */
2044
2127
  "maxzoom"?: number;
2045
2128
  /**
2046
- * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
2129
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The [`feature-state`](expressions/#feature-state) expression is not supported in filter expressions.
2047
2130
  */
2048
2131
  "filter"?: FilterSpecification;
2049
2132
  /**
@@ -2079,7 +2162,7 @@ type FillExtrusionLayerSpecification = {
2079
2162
  "fill-extrusion-opacity"?: PropertyValueSpecification<number>;
2080
2163
  "fill-extrusion-opacity-transition"?: TransitionSpecification;
2081
2164
  /**
2082
- * 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.
2165
+ * 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`](layers/#fill-extrusion-opacity) to set layer opacity.
2083
2166
  *
2084
2167
  * @default
2085
2168
  * ```json
@@ -2099,7 +2182,7 @@ type FillExtrusionLayerSpecification = {
2099
2182
  "fill-extrusion-translate"?: PropertyValueSpecification<[number, number]>;
2100
2183
  "fill-extrusion-translate-transition"?: TransitionSpecification;
2101
2184
  /**
2102
- * Controls the frame of reference for `fill-extrusion-translate`.
2185
+ * Controls the frame of reference for [`fill-extrusion-translate`](layers/#fill-extrusion-translate).
2103
2186
  *
2104
2187
  * @default
2105
2188
  * ```json
@@ -2118,7 +2201,7 @@ type FillExtrusionLayerSpecification = {
2118
2201
  "fill-extrusion-height"?: DataDrivenPropertyValueSpecification<number>;
2119
2202
  "fill-extrusion-height-transition"?: TransitionSpecification;
2120
2203
  /**
2121
- * The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`. Negative values extrude below ground level, e.g. underground floors.
2204
+ * The height with which to extrude the base of this layer. Must be less than or equal to [`fill-extrusion-height`](layers/#fill-extrusion-height). Negative values extrude below ground level, e.g. underground floors.
2122
2205
  */
2123
2206
  "fill-extrusion-base"?: DataDrivenPropertyValueSpecification<number>;
2124
2207
  "fill-extrusion-base-transition"?: TransitionSpecification;
@@ -2165,7 +2248,7 @@ type RasterLayerSpecification = {
2165
2248
  */
2166
2249
  "maxzoom"?: number;
2167
2250
  /**
2168
- * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
2251
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The [`feature-state`](expressions/#feature-state) expression is not supported in filter expressions.
2169
2252
  */
2170
2253
  "filter"?: FilterSpecification;
2171
2254
  /**
@@ -2288,7 +2371,7 @@ type HillshadeLayerSpecification = {
2288
2371
  */
2289
2372
  "maxzoom"?: number;
2290
2373
  /**
2291
- * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
2374
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The [`feature-state`](expressions/#feature-state) expression is not supported in filter expressions.
2292
2375
  */
2293
2376
  "filter"?: FilterSpecification;
2294
2377
  /**
@@ -2310,7 +2393,7 @@ type HillshadeLayerSpecification = {
2310
2393
  */
2311
2394
  "paint"?: {
2312
2395
  /**
2313
- * The direction of the light source(s) 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`. Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.
2396
+ * The direction of the light source(s) used to generate the hillshading with 0 as the top of the viewport if [`hillshade-illumination-anchor`](layers/#hillshade-illumination-anchor) is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`. Only when [`hillshade-method`](layers/#hillshade-method) is set to `multidirectional` can you specify multiple light sources.
2314
2397
  *
2315
2398
  * @default
2316
2399
  * ```json
@@ -2319,7 +2402,7 @@ type HillshadeLayerSpecification = {
2319
2402
  */
2320
2403
  "hillshade-illumination-direction"?: PropertyValueSpecification<NumberArraySpecification>;
2321
2404
  /**
2322
- * The altitude of the light source(s) used to generate the hillshading with 0 as sunset and 90 as noon. Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.
2405
+ * The altitude of the light source(s) used to generate the hillshading with 0 as sunset and 90 as noon. Only when [`hillshade-method`](layers/#hillshade-method) is set to `multidirectional` can you specify multiple light sources.
2323
2406
  *
2324
2407
  * @default
2325
2408
  * ```json
@@ -2347,7 +2430,7 @@ type HillshadeLayerSpecification = {
2347
2430
  "hillshade-exaggeration"?: PropertyValueSpecification<number>;
2348
2431
  "hillshade-exaggeration-transition"?: TransitionSpecification;
2349
2432
  /**
2350
- * The shading color of areas that face away from the light source(s). Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.
2433
+ * The shading color of areas that face away from the light source(s). Only when [`hillshade-method`](layers/#hillshade-method) is set to `multidirectional` can you specify multiple light sources.
2351
2434
  *
2352
2435
  * @default
2353
2436
  * ```json
@@ -2357,7 +2440,7 @@ type HillshadeLayerSpecification = {
2357
2440
  "hillshade-shadow-color"?: PropertyValueSpecification<ColorArraySpecification>;
2358
2441
  "hillshade-shadow-color-transition"?: TransitionSpecification;
2359
2442
  /**
2360
- * The shading color of areas that faces towards the light source(s). Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.
2443
+ * The shading color of areas that faces towards the light source(s). Only when [`hillshade-method`](layers/#hillshade-method) is set to `multidirectional` can you specify multiple light sources.
2361
2444
  *
2362
2445
  * @default
2363
2446
  * ```json
@@ -2430,7 +2513,7 @@ type ColorReliefLayerSpecification = {
2430
2513
  */
2431
2514
  "maxzoom"?: number;
2432
2515
  /**
2433
- * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions.
2516
+ * A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The [`feature-state`](expressions/#feature-state) expression is not supported in filter expressions.
2434
2517
  */
2435
2518
  "filter"?: FilterSpecification;
2436
2519
  /**
@@ -2462,7 +2545,7 @@ type ColorReliefLayerSpecification = {
2462
2545
  "color-relief-opacity"?: PropertyValueSpecification<number>;
2463
2546
  "color-relief-opacity-transition"?: TransitionSpecification;
2464
2547
  /**
2465
- * Defines the color of each pixel based on its elevation. Should be an expression that uses `["elevation"]` as input.
2548
+ * Defines the color of each pixel based on its elevation. Should be an expression that uses the [`elevation`](expressions/#elevation) expression as input.
2466
2549
  *
2467
2550
  * @example
2468
2551
  * ```json
@@ -2559,8 +2642,6 @@ type BackgroundLayerSpecification = {
2559
2642
  };
2560
2643
  };
2561
2644
  type LayerSpecification = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | RasterLayerSpecification | HillshadeLayerSpecification | ColorReliefLayerSpecification | BackgroundLayerSpecification;
2562
- //#endregion
2563
- //#region src/expression/types/color_spaces.d.ts
2564
2645
  /**
2565
2646
  * @param r Red component 0..1
2566
2647
  * @param g Green component 0..1
@@ -2582,8 +2663,6 @@ type HCLColor = [h: number, c: number, l: number, alpha: number];
2582
2663
  * @param alpha Alpha component 0..1
2583
2664
  */
2584
2665
  type LABColor = [l: number, a: number, b: number, alpha: number];
2585
- //#endregion
2586
- //#region src/expression/types/color.d.ts
2587
2666
  type InterpolationColorSpace = 'rgb' | 'hcl' | 'lab';
2588
2667
  /**
2589
2668
  * Color representation used by WebGL.
@@ -2674,14 +2753,10 @@ declare class Color {
2674
2753
  toString(): string;
2675
2754
  static interpolate(from: Color, to: Color, t: number, spaceKey?: InterpolationColorSpace): Color;
2676
2755
  }
2677
- //#endregion
2678
- //#region src/point2d.d.ts
2679
2756
  interface Point2D$1 {
2680
2757
  x: number;
2681
2758
  y: number;
2682
2759
  }
2683
- //#endregion
2684
- //#region src/expression/index.d.ts
2685
2760
  type Feature$1 = {
2686
2761
  readonly type: 0 | 1 | 2 | 3 | 'Unknown' | 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon';
2687
2762
  readonly id?: any;
package/dist/index.js CHANGED
@@ -7470,7 +7470,7 @@ function pixelAlignedBox(project) {
7470
7470
  return [minX, minY, maxX, maxY];
7471
7471
  }
7472
7472
 
7473
- //#region src/reference/v8.json
7473
+ // src/reference/v8.json
7474
7474
  var v8_default = {
7475
7475
  $version: 8,
7476
7476
  $root: {
@@ -7565,6 +7565,14 @@ var v8_default = {
7565
7565
  },
7566
7566
  "default": "xyz"
7567
7567
  },
7568
+ "emptyResponse": {
7569
+ "type": "enum",
7570
+ "values": {
7571
+ "blank": {},
7572
+ "missing": {}
7573
+ },
7574
+ "default": "blank"
7575
+ },
7568
7576
  "minzoom": {
7569
7577
  "type": "number",
7570
7578
  "default": 0
@@ -7632,6 +7640,14 @@ var v8_default = {
7632
7640
  },
7633
7641
  "default": "xyz"
7634
7642
  },
7643
+ "emptyResponse": {
7644
+ "type": "enum",
7645
+ "values": {
7646
+ "blank": {},
7647
+ "missing": {}
7648
+ },
7649
+ "default": "blank"
7650
+ },
7635
7651
  "attribution": { "type": "string" },
7636
7652
  "volatile": {
7637
7653
  "type": "boolean",
@@ -7674,6 +7690,14 @@ var v8_default = {
7674
7690
  "default": 512,
7675
7691
  "units": "pixels"
7676
7692
  },
7693
+ "emptyResponse": {
7694
+ "type": "enum",
7695
+ "values": {
7696
+ "blank": {},
7697
+ "missing": {}
7698
+ },
7699
+ "default": "blank"
7700
+ },
7677
7701
  "attribution": { "type": "string" },
7678
7702
  "encoding": {
7679
7703
  "type": "enum",
@@ -8953,6 +8977,21 @@ var v8_default = {
8953
8977
  },
8954
8978
  "property-type": "data-constant"
8955
8979
  },
8980
+ "fill-layer-blend": {
8981
+ "type": "enum",
8982
+ "values": {
8983
+ "normal": {},
8984
+ "multiply": {},
8985
+ "color": {},
8986
+ "luminosity": {},
8987
+ "plus-lighter": {},
8988
+ "screen": {},
8989
+ "overlay": {}
8990
+ },
8991
+ "default": "normal",
8992
+ "property-type": "constant",
8993
+ "transition": false
8994
+ },
8956
8995
  "fill-color": {
8957
8996
  "type": "color",
8958
8997
  "default": "#000000",
@@ -9041,7 +9080,8 @@ var v8_default = {
9041
9080
  "parameters": [
9042
9081
  "zoom",
9043
9082
  "feature",
9044
- "feature-state"
9083
+ "feature-state",
9084
+ "elevation"
9045
9085
  ]
9046
9086
  },
9047
9087
  "property-type": "data-driven"
@@ -9153,6 +9193,21 @@ var v8_default = {
9153
9193
  },
9154
9194
  "property-type": "data-constant"
9155
9195
  },
9196
+ "line-layer-blend": {
9197
+ "type": "enum",
9198
+ "values": {
9199
+ "normal": {},
9200
+ "multiply": {},
9201
+ "color": {},
9202
+ "luminosity": {},
9203
+ "plus-lighter": {},
9204
+ "screen": {},
9205
+ "overlay": {}
9206
+ },
9207
+ "default": "normal",
9208
+ "property-type": "constant",
9209
+ "transition": false
9210
+ },
9156
9211
  "line-color": {
9157
9212
  "type": "color",
9158
9213
  "default": "#000000",
@@ -10135,10 +10190,10 @@ var v8_default = {
10135
10190
  }
10136
10191
  };
10137
10192
 
10138
- //#region src/reference/latest.ts
10193
+ // src/reference/latest.ts
10139
10194
  const latest = v8_default;
10140
10195
 
10141
- //#region src/expression/types.ts
10196
+ // src/expression/types.ts
10142
10197
  const NullType = { kind: "null" };
10143
10198
  const NumberType = { kind: "number" };
10144
10199
  const StringType = { kind: "string" };
@@ -10234,7 +10289,7 @@ function verifyType(provided, sample) {
10234
10289
  return provided.kind === sample.kind;
10235
10290
  }
10236
10291
 
10237
- //#region src/expression/types/color_spaces.ts
10292
+ // src/expression/types/color_spaces.ts
10238
10293
  const Xn = .96422;
10239
10294
  const Yn = 1;
10240
10295
  const Zn = .82521;
@@ -10329,7 +10384,7 @@ function hslToRgb([h, s, l, alpha]) {
10329
10384
  ];
10330
10385
  }
10331
10386
 
10332
- //#region src/util/get_own.ts
10387
+ // src/util/get_own.ts
10333
10388
  const hasOwnProperty = Object.hasOwn || function hasOwnProperty(object, key) {
10334
10389
  return Object.prototype.hasOwnProperty.call(object, key);
10335
10390
  };
@@ -10337,7 +10392,7 @@ function getOwn(object, key) {
10337
10392
  return hasOwnProperty(object, key) ? object[key] : void 0;
10338
10393
  }
10339
10394
 
10340
- //#region src/expression/types/parse_css_color.ts
10395
+ // src/expression/types/parse_css_color.ts
10341
10396
  /**
10342
10397
  * CSS color parser compliant with CSS Color 4 Specification.
10343
10398
  * Supports: named colors, `transparent` keyword, all rgb hex notations,
@@ -11215,7 +11270,7 @@ const namedColors = {
11215
11270
  ]
11216
11271
  };
11217
11272
 
11218
- //#region src/util/interpolate-primitives.ts
11273
+ // src/util/interpolate-primitives.ts
11219
11274
  function interpolateNumber(from, to, t) {
11220
11275
  return from + t * (to - from);
11221
11276
  }
@@ -11225,7 +11280,7 @@ function interpolateArray(from, to, t) {
11225
11280
  });
11226
11281
  }
11227
11282
 
11228
- //#region src/expression/types/color.ts
11283
+ // src/expression/types/color.ts
11229
11284
  /**
11230
11285
  * Checks whether the specified color space is one of the supported interpolation color spaces.
11231
11286
  *
@@ -11409,7 +11464,7 @@ var Color$1 = class Color {
11409
11464
  }
11410
11465
  };
11411
11466
 
11412
- //#region src/expression/types/formatted.ts
11467
+ // src/expression/types/formatted.ts
11413
11468
  const VERTICAL_ALIGN_OPTIONS = [
11414
11469
  "bottom",
11415
11470
  "center",
@@ -11446,7 +11501,7 @@ var Formatted = class Formatted {
11446
11501
  }
11447
11502
  };
11448
11503
 
11449
- //#region src/expression/types/padding.ts
11504
+ // src/expression/types/padding.ts
11450
11505
  /**
11451
11506
  * A set of four numbers representing padding around a box. Create instances from
11452
11507
  * bare arrays or numeric values using the static method `Padding.parse`.
@@ -11506,7 +11561,7 @@ var Padding = class Padding {
11506
11561
  }
11507
11562
  };
11508
11563
 
11509
- //#region src/expression/types/number_array.ts
11564
+ // src/expression/types/number_array.ts
11510
11565
  /**
11511
11566
  * An array of numbers. Create instances from
11512
11567
  * bare arrays or numeric values using the static method `NumberArray.parse`.
@@ -11536,7 +11591,7 @@ var NumberArray = class NumberArray {
11536
11591
  }
11537
11592
  };
11538
11593
 
11539
- //#region src/expression/types/color_array.ts
11594
+ // src/expression/types/color_array.ts
11540
11595
  /**
11541
11596
  * An array of colors. Create instances from
11542
11597
  * bare arrays or strings using the static method `ColorArray.parse`.
@@ -11579,7 +11634,7 @@ var ColorArray = class ColorArray {
11579
11634
  }
11580
11635
  };
11581
11636
 
11582
- //#region src/expression/runtime_error.ts
11637
+ // src/expression/runtime_error.ts
11583
11638
  var RuntimeError = class extends Error {
11584
11639
  constructor(message, path) {
11585
11640
  super(message);
@@ -11591,7 +11646,7 @@ var RuntimeError = class extends Error {
11591
11646
  }
11592
11647
  };
11593
11648
 
11594
- //#region src/expression/types/variable_anchor_offset_collection.ts
11649
+ // src/expression/types/variable_anchor_offset_collection.ts
11595
11650
  /** Set of valid anchor positions, as a set for validation */
11596
11651
  const anchors = /* @__PURE__ */ new Set([
11597
11652
  "center",
@@ -11643,7 +11698,7 @@ var VariableAnchorOffsetCollection = class VariableAnchorOffsetCollection {
11643
11698
  }
11644
11699
  };
11645
11700
 
11646
- //#region src/expression/types/resolved_image.ts
11701
+ // src/expression/types/resolved_image.ts
11647
11702
  var ResolvedImage = class ResolvedImage {
11648
11703
  constructor(options) {
11649
11704
  this.name = options.name;
@@ -11661,7 +11716,7 @@ var ResolvedImage = class ResolvedImage {
11661
11716
  }
11662
11717
  };
11663
11718
 
11664
- //#region src/expression/types/projection_definition.ts
11719
+ // src/expression/types/projection_definition.ts
11665
11720
  var ProjectionDefinition = class ProjectionDefinition {
11666
11721
  constructor(from, to, transition) {
11667
11722
  this.from = from;
@@ -11687,7 +11742,7 @@ var ProjectionDefinition = class ProjectionDefinition {
11687
11742
  }
11688
11743
  };
11689
11744
 
11690
- //#region src/expression/types/collator.ts
11745
+ // src/expression/types/collator.ts
11691
11746
  var Collator = class {
11692
11747
  constructor(caseSensitive, diacriticSensitive, locale) {
11693
11748
  if (caseSensitive) this.sensitivity = diacriticSensitive ? "variant" : "case";
@@ -11706,7 +11761,7 @@ var Collator = class {
11706
11761
  }
11707
11762
  };
11708
11763
 
11709
- //#region src/expression/values.ts
11764
+ // src/expression/values.ts
11710
11765
  function validateRGBA(r, g, b, a) {
11711
11766
  if (!(typeof r === "number" && r >= 0 && r <= 255 && typeof g === "number" && g >= 0 && g <= 255 && typeof b === "number" && b >= 0 && b <= 255)) return `Invalid rgba value [${(typeof a === "number" ? [
11712
11767
  r,
@@ -11773,7 +11828,7 @@ function valueToString(value) {
11773
11828
  else return JSON.stringify(value);
11774
11829
  }
11775
11830
 
11776
- //#region src/expression/definitions/literal.ts
11831
+ // src/expression/definitions/literal.ts
11777
11832
  var Literal = class Literal {
11778
11833
  constructor(type, value) {
11779
11834
  this.type = type;
@@ -11797,7 +11852,7 @@ var Literal = class Literal {
11797
11852
  }
11798
11853
  };
11799
11854
 
11800
- //#region src/expression/evaluation_context.ts
11855
+ // src/expression/evaluation_context.ts
11801
11856
  const geometryTypes = [
11802
11857
  "Unknown",
11803
11858
  "Point",
@@ -11839,7 +11894,7 @@ var EvaluationContext = class {
11839
11894
  }
11840
11895
  };
11841
11896
 
11842
- //#region src/expression/stops.ts
11897
+ // src/expression/stops.ts
11843
11898
  /**
11844
11899
  * Returns the index of the last stop <= input, or 0 if it doesn't exist.
11845
11900
  * @private
@@ -11863,7 +11918,7 @@ function findStopLessThanOrEqualTo(stops, input, key) {
11863
11918
  return 0;
11864
11919
  }
11865
11920
 
11866
- //#region src/expression/definitions/step.ts
11921
+ // src/expression/definitions/step.ts
11867
11922
  var Step = class Step {
11868
11923
  constructor(type, input, stops, key) {
11869
11924
  this.type = type;
@@ -11917,7 +11972,7 @@ var Step = class Step {
11917
11972
  }
11918
11973
  };
11919
11974
 
11920
- //#region node_modules/@mapbox/unitbezier/index.js
11975
+ // node_modules/@mapbox/unitbezier/index.js
11921
11976
  function unitBezier(p1x, p1y, p2x, p2y) {
11922
11977
  const cx = 3 * p1x;
11923
11978
  const bx = 3 * (p2x - p1x) - cx;
@@ -11950,7 +12005,7 @@ function unitBezier(p1x, p1y, p2x, p2y) {
11950
12005
  };
11951
12006
  }
11952
12007
 
11953
- //#region src/expression/definitions/interpolate.ts
12008
+ // src/expression/definitions/interpolate.ts
11954
12009
  var Interpolate = class Interpolate {
11955
12010
  constructor(type, operator, interpolation, input, stops, key) {
11956
12011
  this.type = type;
@@ -12112,7 +12167,7 @@ const interpolateFactory = {
12112
12167
  array: interpolateArray
12113
12168
  };
12114
12169
 
12115
- //#region src/expression/definitions/format.ts
12170
+ // src/expression/definitions/format.ts
12116
12171
  var FormatExpression = class FormatExpression {
12117
12172
  constructor(sections) {
12118
12173
  this.type = FormattedType;
@@ -12193,7 +12248,7 @@ var FormatExpression = class FormatExpression {
12193
12248
  }
12194
12249
  };
12195
12250
 
12196
- //#region src/util/classify_rings.ts
12251
+ // src/util/classify_rings.ts
12197
12252
  /**
12198
12253
  * Classifies an array of rings into polygons with outer rings and holes
12199
12254
  * @param rings - the rings to classify
@@ -12236,7 +12291,7 @@ function calculateSignedArea(ring) {
12236
12291
  return sum;
12237
12292
  }
12238
12293
 
12239
- //#region src/expression/definitions/assertion.ts
12294
+ // src/expression/definitions/assertion.ts
12240
12295
  const types$1 = {
12241
12296
  string: StringType,
12242
12297
  number: NumberType,
@@ -12297,7 +12352,7 @@ var Assertion = class Assertion {
12297
12352
  }
12298
12353
  };
12299
12354
 
12300
- //#region src/expression/definitions/coercion.ts
12355
+ // src/expression/definitions/coercion.ts
12301
12356
  const types = {
12302
12357
  "to-boolean": BooleanType,
12303
12358
  "to-color": ColorType,
@@ -12417,7 +12472,7 @@ var Coercion = class Coercion {
12417
12472
  }
12418
12473
  };
12419
12474
 
12420
- //#region src/expression/definitions/let.ts
12475
+ // src/expression/definitions/let.ts
12421
12476
  var Let = class Let {
12422
12477
  constructor(bindings, result) {
12423
12478
  this.type = result.type;
@@ -12451,7 +12506,7 @@ var Let = class Let {
12451
12506
  }
12452
12507
  };
12453
12508
 
12454
- //#region src/expression/definitions/var.ts
12509
+ // src/expression/definitions/var.ts
12455
12510
  var Var = class Var {
12456
12511
  constructor(name, boundExpression) {
12457
12512
  this.type = boundExpression.type;
@@ -12473,7 +12528,7 @@ var Var = class Var {
12473
12528
  }
12474
12529
  };
12475
12530
 
12476
- //#region src/expression/definitions/at.ts
12531
+ // src/expression/definitions/at.ts
12477
12532
  var At = class At {
12478
12533
  constructor(type, index, input, key) {
12479
12534
  this.type = type;
@@ -12506,7 +12561,7 @@ var At = class At {
12506
12561
  }
12507
12562
  };
12508
12563
 
12509
- //#region src/expression/definitions/in.ts
12564
+ // src/expression/definitions/in.ts
12510
12565
  var In = class In {
12511
12566
  constructor(needle, haystack, key) {
12512
12567
  this.needle = needle;
@@ -12550,7 +12605,7 @@ var In = class In {
12550
12605
  }
12551
12606
  };
12552
12607
 
12553
- //#region src/expression/definitions/index_of.ts
12608
+ // src/expression/definitions/index_of.ts
12554
12609
  var IndexOf = class IndexOf {
12555
12610
  constructor(needle, haystack, key, fromIndex) {
12556
12611
  this.needle = needle;
@@ -12605,7 +12660,7 @@ var IndexOf = class IndexOf {
12605
12660
  }
12606
12661
  };
12607
12662
 
12608
- //#region src/expression/definitions/match.ts
12663
+ // src/expression/definitions/match.ts
12609
12664
  var Match = class Match {
12610
12665
  constructor(inputType, outputType, input, cases, outputs, otherwise) {
12611
12666
  this.inputType = inputType;
@@ -12664,7 +12719,7 @@ var Match = class Match {
12664
12719
  }
12665
12720
  };
12666
12721
 
12667
- //#region src/expression/definitions/case.ts
12722
+ // src/expression/definitions/case.ts
12668
12723
  var Case = class Case {
12669
12724
  constructor(type, branches, otherwise) {
12670
12725
  this.type = type;
@@ -12706,7 +12761,7 @@ var Case = class Case {
12706
12761
  }
12707
12762
  };
12708
12763
 
12709
- //#region src/expression/definitions/slice.ts
12764
+ // src/expression/definitions/slice.ts
12710
12765
  var Slice = class Slice {
12711
12766
  constructor(type, input, beginIndex, key, endIndex) {
12712
12767
  this.type = type;
@@ -12750,7 +12805,7 @@ var Slice = class Slice {
12750
12805
  }
12751
12806
  };
12752
12807
 
12753
- //#region src/expression/definitions/coalesce.ts
12808
+ // src/expression/definitions/coalesce.ts
12754
12809
  var Coalesce = class Coalesce {
12755
12810
  constructor(type, args) {
12756
12811
  this.type = type;
@@ -12795,7 +12850,7 @@ var Coalesce = class Coalesce {
12795
12850
  }
12796
12851
  };
12797
12852
 
12798
- //#region src/expression/definitions/comparison.ts
12853
+ // src/expression/definitions/comparison.ts
12799
12854
  function isComparableType(op, type) {
12800
12855
  if (op === "==" || op === "!=") return type.kind === "boolean" || type.kind === "string" || type.kind === "number" || type.kind === "null" || type.kind === "value";
12801
12856
  else return type.kind === "string" || type.kind === "number" || type.kind === "value";
@@ -12918,7 +12973,7 @@ const GreaterThan = makeComparison(">", gt, gtCollate);
12918
12973
  const LessThanOrEqual = makeComparison("<=", lteq, lteqCollate);
12919
12974
  const GreaterThanOrEqual = makeComparison(">=", gteq, gteqCollate);
12920
12975
 
12921
- //#region src/expression/definitions/collator.ts
12976
+ // src/expression/definitions/collator.ts
12922
12977
  var CollatorExpression = class CollatorExpression {
12923
12978
  constructor(caseSensitive, diacriticSensitive, locale) {
12924
12979
  this.type = CollatorType;
@@ -12954,7 +13009,7 @@ var CollatorExpression = class CollatorExpression {
12954
13009
  }
12955
13010
  };
12956
13011
 
12957
- //#region src/expression/definitions/number_format.ts
13012
+ // src/expression/definitions/number_format.ts
12958
13013
  var NumberFormat = class NumberFormat {
12959
13014
  constructor(number, locale, currency, unit, minFractionDigits, maxFractionDigits) {
12960
13015
  this.type = StringType;
@@ -13021,7 +13076,7 @@ var NumberFormat = class NumberFormat {
13021
13076
  }
13022
13077
  };
13023
13078
 
13024
- //#region src/expression/definitions/image.ts
13079
+ // src/expression/definitions/image.ts
13025
13080
  var ImageExpression = class ImageExpression {
13026
13081
  constructor(input) {
13027
13082
  this.type = ResolvedImageType;
@@ -13047,7 +13102,7 @@ var ImageExpression = class ImageExpression {
13047
13102
  }
13048
13103
  };
13049
13104
 
13050
- //#region src/expression/definitions/length.ts
13105
+ // src/expression/definitions/length.ts
13051
13106
  var Length = class Length {
13052
13107
  constructor(input, key) {
13053
13108
  this.input = input;
@@ -13075,7 +13130,7 @@ var Length = class Length {
13075
13130
  }
13076
13131
  };
13077
13132
 
13078
- //#region src/util/geometry_util.ts
13133
+ // src/util/geometry_util.ts
13079
13134
  const EXTENT = 8192;
13080
13135
  function getTileCoordinates(p, canonical) {
13081
13136
  const x = mercatorXfromLng(p[0]);
@@ -13171,7 +13226,7 @@ function twoSided(p1, p2, q1, q2) {
13171
13226
  return false;
13172
13227
  }
13173
13228
 
13174
- //#region src/expression/definitions/within.ts
13229
+ // src/expression/definitions/within.ts
13175
13230
  function getTilePolygon(coordinates, bbox, canonical) {
13176
13231
  const polygon = [];
13177
13232
  for (let i = 0; i < coordinates.length; i++) {
@@ -13333,7 +13388,7 @@ var Within = class Within {
13333
13388
  }
13334
13389
  };
13335
13390
 
13336
- //#region node_modules/tinyqueue/index.js
13391
+ // node_modules/tinyqueue/index.js
13337
13392
  var TinyQueue = class {
13338
13393
  constructor(data = [], compare = (a, b) => a < b ? -1 : a > b ? 1 : 0) {
13339
13394
  this.data = data;
@@ -13386,7 +13441,7 @@ var TinyQueue = class {
13386
13441
  }
13387
13442
  };
13388
13443
 
13389
- //#region src/util/cheap_ruler.ts
13444
+ // src/util/cheap_ruler.ts
13390
13445
  const RE = 6378.137;
13391
13446
  const E2 = .0066943799901413165;
13392
13447
  const RAD = Math.PI / 180;
@@ -13469,7 +13524,7 @@ var CheapRuler = class {
13469
13524
  }
13470
13525
  };
13471
13526
 
13472
- //#region src/expression/definitions/distance.ts
13527
+ // src/expression/definitions/distance.ts
13473
13528
  const MinPointsSize = 100;
13474
13529
  const MinLinePointsSize = 50;
13475
13530
  function compareDistPair(a, b) {
@@ -13837,7 +13892,7 @@ var Distance = class Distance {
13837
13892
  }
13838
13893
  };
13839
13894
 
13840
- //#region src/expression/definitions/semiliteral.ts
13895
+ // src/expression/definitions/semiliteral.ts
13841
13896
  var Semiliteral = class Semiliteral {
13842
13897
  constructor(arr) {
13843
13898
  let elementType = null;
@@ -13878,7 +13933,7 @@ var Semiliteral = class Semiliteral {
13878
13933
  }
13879
13934
  };
13880
13935
 
13881
- //#region src/expression/definitions/global_state.ts
13936
+ // src/expression/definitions/global_state.ts
13882
13937
  var GlobalState = class GlobalState {
13883
13938
  constructor(key) {
13884
13939
  this.key = key;
@@ -13902,7 +13957,7 @@ var GlobalState = class GlobalState {
13902
13957
  }
13903
13958
  };
13904
13959
 
13905
- //#region src/expression/definitions/index.ts
13960
+ // src/expression/definitions/index.ts
13906
13961
  const expressions = {
13907
13962
  "==": Equals,
13908
13963
  "!=": NotEquals,
@@ -13944,7 +13999,7 @@ const expressions = {
13944
13999
  "global-state": GlobalState
13945
14000
  };
13946
14001
 
13947
- //#region src/expression/parsing_error.ts
14002
+ // src/expression/parsing_error.ts
13948
14003
  var ExpressionParsingError = class extends Error {
13949
14004
  constructor(key, message) {
13950
14005
  super(message);
@@ -13953,7 +14008,7 @@ var ExpressionParsingError = class extends Error {
13953
14008
  }
13954
14009
  };
13955
14010
 
13956
- //#region src/expression/scope.ts
14011
+ // src/expression/scope.ts
13957
14012
  /**
13958
14013
  * Tracks `let` bindings during expression parsing.
13959
14014
  * @private
@@ -13978,7 +14033,7 @@ var Scope = class Scope {
13978
14033
  }
13979
14034
  };
13980
14035
 
13981
- //#region src/expression/parsing_context.ts
14036
+ // src/expression/parsing_context.ts
13982
14037
  /**
13983
14038
  * State associated parsing at a given point in an expression tree.
13984
14039
  * @private
@@ -14100,7 +14155,7 @@ var ParsingContext = class ParsingContext {
14100
14155
  }
14101
14156
  };
14102
14157
 
14103
- //#region src/expression/compound_expression.ts
14158
+ // src/expression/compound_expression.ts
14104
14159
  var CompoundExpression = class CompoundExpression {
14105
14160
  constructor(name, type, evaluate, args, key) {
14106
14161
  this.name = name;
@@ -14675,7 +14730,7 @@ function isGlobalPropertyConstant(e, properties) {
14675
14730
  return result;
14676
14731
  }
14677
14732
 
14678
- //#region src/util/properties.ts
14733
+ // src/util/properties.ts
14679
14734
  function supportsPropertyExpression(spec) {
14680
14735
  return spec["property-type"] === "data-driven" || spec["property-type"] === "cross-faded-data-driven";
14681
14736
  }
@@ -14686,13 +14741,13 @@ function supportsInterpolation(spec) {
14686
14741
  return !!spec.expression && spec.expression.interpolated;
14687
14742
  }
14688
14743
 
14689
- //#region src/util/extend.ts
14744
+ // src/util/extend.ts
14690
14745
  function extendBy(output, ...inputs) {
14691
14746
  for (const input of inputs) for (const k in input) output[k] = input[k];
14692
14747
  return output;
14693
14748
  }
14694
14749
 
14695
- //#region src/util/get_type.ts
14750
+ // src/util/get_type.ts
14696
14751
  function getType(val) {
14697
14752
  if (val instanceof Number) return "number";
14698
14753
  else if (val instanceof String) return "string";
@@ -14702,7 +14757,7 @@ function getType(val) {
14702
14757
  else return typeof val;
14703
14758
  }
14704
14759
 
14705
- //#region src/function/index.ts
14760
+ // src/function/index.ts
14706
14761
  function isFunction(value) {
14707
14762
  return typeof value === "object" && value !== null && !Array.isArray(value) && typeOf(value) === ObjectType;
14708
14763
  }
@@ -14911,7 +14966,7 @@ function interpolationFactor(input, base, lowerValue, upperValue) {
14911
14966
  else return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);
14912
14967
  }
14913
14968
 
14914
- //#region src/util/result.ts
14969
+ // src/util/result.ts
14915
14970
  function success(value) {
14916
14971
  return {
14917
14972
  result: "success",
@@ -14925,7 +14980,7 @@ function error(value) {
14925
14980
  };
14926
14981
  }
14927
14982
 
14928
- //#region src/expression/index.ts
14983
+ // src/expression/index.ts
14929
14984
  var StyleExpression = class {
14930
14985
  constructor(expression, rootKey, propertySpec, globalState) {
14931
14986
  this.expression = expression;
@@ -15140,21 +15195,26 @@ function normalizePropertyExpression(value, rootKey, specification, globalState)
15140
15195
  };
15141
15196
  }
15142
15197
  }
15143
- function findZoomCurve(expression) {
15198
+ function findZoomCurve(expression, seen = /* @__PURE__ */ new Map()) {
15199
+ if (seen.has(expression)) return seen.get(expression);
15144
15200
  let result = null;
15145
- if (expression instanceof Let) result = findZoomCurve(expression.result);
15201
+ if (expression instanceof Let) result = findZoomCurve(expression.result, seen);
15146
15202
  else if (expression instanceof Coalesce) for (const arg of expression.args) {
15147
- result = findZoomCurve(arg);
15203
+ result = findZoomCurve(arg, seen);
15148
15204
  if (result) break;
15149
15205
  }
15150
15206
  else if ((expression instanceof Step || expression instanceof Interpolate) && expression.input instanceof CompoundExpression && expression.input.name === "zoom") result = expression;
15151
- if (result instanceof ExpressionParsingError) return result;
15207
+ if (result instanceof ExpressionParsingError) {
15208
+ seen.set(expression, result);
15209
+ return result;
15210
+ }
15152
15211
  expression.eachChild((child) => {
15153
- const childResult = findZoomCurve(child);
15212
+ const childResult = findZoomCurve(child, seen);
15154
15213
  if (childResult instanceof ExpressionParsingError) result = childResult;
15155
15214
  else if (!result && childResult) result = new ExpressionParsingError("", "\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.");
15156
15215
  else if (result && childResult && result !== childResult) result = new ExpressionParsingError("", "Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.");
15157
15216
  });
15217
+ seen.set(expression, result);
15158
15218
  return result;
15159
15219
  }
15160
15220
  function findGlobalStateRefs(expression, results = /* @__PURE__ */ new Set()) {
@@ -15207,7 +15267,7 @@ function addGlobalState(globals, globalState) {
15207
15267
  };
15208
15268
  }
15209
15269
 
15210
- //#region src/feature_filter/index.ts
15270
+ // src/feature_filter/index.ts
15211
15271
  function classifyChildren(children) {
15212
15272
  let sawLegacy = false;
15213
15273
  for (const child of children) {
@@ -15420,7 +15480,7 @@ function convertNegation(filter) {
15420
15480
  return ["!", filter];
15421
15481
  }
15422
15482
 
15423
- //#region src/expression/visibility.ts
15483
+ // src/expression/visibility.ts
15424
15484
  const visibilitySpec = {
15425
15485
  type: "enum",
15426
15486
  "property-type": "data-constant",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versatiles/svg-renderer",
3
- "version": "2.4.1",
3
+ "version": "2.5.0",
4
4
  "description": "Renders MapLibre styles as SVG, in Node.js or the browser.",
5
5
  "keywords": [
6
6
  "svg",