@versatiles/png-renderer 2.4.2 → 2.6.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.
package/dist/index.d.ts CHANGED
@@ -2,8 +2,6 @@
2
2
  import { Canvas } from '@napi-rs/canvas';
3
3
  export { Canvas } from '@napi-rs/canvas';
4
4
 
5
- //#endregion
6
- //#region src/types.g.d.ts
7
5
  type ColorSpecification = string;
8
6
  type ProjectionDefinitionT = [string, string, number];
9
7
  type ProjectionDefinitionSpecification = string | ProjectionDefinitionT | PropertyValueSpecification<ProjectionDefinitionT>;
@@ -209,7 +207,7 @@ type StyleSpecification = {
209
207
  */
210
208
  "roll"?: number;
211
209
  /**
212
- * An object used to define default values when using the [`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression.
210
+ * An object used to define default values when using the [`global-state`](expressions/#global-state) expression.
213
211
  *
214
212
  * @default
215
213
  * ```json
@@ -292,7 +290,7 @@ type StyleSpecification = {
292
290
  /**
293
291
  * 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.
294
292
  *
295
- * Tiled sources (vector and raster) must specify their details according to the [TileJSON specification](https://github.com/mapbox/tilejson-spec).
293
+ * Tiled sources (vector and raster) must specify their details according to [TileJSON](tilejson.md).
296
294
  *
297
295
  * @example
298
296
  * ```json
@@ -338,7 +336,7 @@ type StyleSpecification = {
338
336
  /**
339
337
  * A URL template for loading signed-distance-field glyph sets in PBF format.
340
338
  *
341
- * 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.
339
+ * 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.
342
340
  *
343
341
  * The URL must include:
344
342
  *
@@ -581,7 +579,19 @@ type VectorSourceSpecification = {
581
579
  */
582
580
  "url"?: string;
583
581
  /**
584
- * An array of one or more tile source URLs, as in the TileJSON spec.
582
+ * An array of one or more tile source URLs, as in the TileJSON spec. These tokens in a URL are replaced for each tile:
583
+ *
584
+ * - `{z}`, `{x}` and `{y}` - The tile's zoom level, column and row. With `scheme` set to `tms`, the row counts from the bottom.
585
+ *
586
+ * - `{quadkey}` - The tile's quadkey, as Bing Maps addresses tiles.
587
+ *
588
+ * - `{bbox-epsg-3857}` - The tile's bounding box in EPSG:3857 meters, as `minX,minY,maxX,maxY`, for WMS requests.
589
+ *
590
+ * - `{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}`.
591
+ *
592
+ * - `{prefix}` - Two hexadecimal digits from the tile's column and row, to spread requests over host names.
593
+ *
594
+ * - `{ratio}` - `@2x` where the device pixel ratio is above 1, empty otherwise.
585
595
  */
586
596
  "tiles"?: Array<string>;
587
597
  /**
@@ -602,6 +612,15 @@ type VectorSourceSpecification = {
602
612
  * ```
603
613
  */
604
614
  "scheme"?: "xyz" | "tms";
615
+ /**
616
+ * Experimental. What an empty tile response (HTTP 204, or no tile data from an archive such as PMTiles) means in this tileset.
617
+ *
618
+ * @default
619
+ * ```json
620
+ * "blank"
621
+ * ```
622
+ */
623
+ "emptyResponse"?: "blank" | "missing";
605
624
  /**
606
625
  * Minimum zoom level for which tiles are available, as in the TileJSON spec.
607
626
  */
@@ -647,7 +666,19 @@ type RasterSourceSpecification = {
647
666
  */
648
667
  "url"?: string;
649
668
  /**
650
- * An array of one or more tile source URLs, as in the TileJSON spec.
669
+ * An array of one or more tile source URLs, as in the TileJSON spec. These tokens in a URL are replaced for each tile:
670
+ *
671
+ * - `{z}`, `{x}` and `{y}` - The tile's zoom level, column and row. With `scheme` set to `tms`, the row counts from the bottom.
672
+ *
673
+ * - `{quadkey}` - The tile's quadkey, as Bing Maps addresses tiles.
674
+ *
675
+ * - `{bbox-epsg-3857}` - The tile's bounding box in EPSG:3857 meters, as `minX,minY,maxX,maxY`, for WMS requests.
676
+ *
677
+ * - `{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}`.
678
+ *
679
+ * - `{prefix}` - Two hexadecimal digits from the tile's column and row, to spread requests over host names.
680
+ *
681
+ * - `{ratio}` - `@2x` where the device pixel ratio is above 1, empty otherwise.
651
682
  */
652
683
  "tiles"?: Array<string>;
653
684
  /**
@@ -673,7 +704,7 @@ type RasterSourceSpecification = {
673
704
  */
674
705
  "maxzoom"?: number;
675
706
  /**
676
- * The minimum visual size to display tiles for this layer. Only configurable for raster layers.
707
+ * The minimum visual size to display tiles for this source.
677
708
  *
678
709
  * @default
679
710
  * ```json
@@ -690,6 +721,15 @@ type RasterSourceSpecification = {
690
721
  * ```
691
722
  */
692
723
  "scheme"?: "xyz" | "tms";
724
+ /**
725
+ * Experimental. What an empty tile response (HTTP 204, or no tile data from an archive such as PMTiles) means in this tileset.
726
+ *
727
+ * @default
728
+ * ```json
729
+ * "blank"
730
+ * ```
731
+ */
732
+ "emptyResponse"?: "blank" | "missing";
693
733
  /**
694
734
  * Contains an attribution to be displayed when the map is shown to a user.
695
735
  */
@@ -709,7 +749,19 @@ type RasterDEMSourceSpecification = {
709
749
  */
710
750
  "url"?: string;
711
751
  /**
712
- * An array of one or more tile source URLs, as in the TileJSON spec.
752
+ * An array of one or more tile source URLs, as in the TileJSON spec. These tokens in a URL are replaced for each tile:
753
+ *
754
+ * - `{z}`, `{x}` and `{y}` - The tile's zoom level, column and row.
755
+ *
756
+ * - `{quadkey}` - The tile's quadkey, as Bing Maps addresses tiles.
757
+ *
758
+ * - `{bbox-epsg-3857}` - The tile's bounding box in EPSG:3857 meters, as `minX,minY,maxX,maxY`, for WMS requests.
759
+ *
760
+ * - `{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}`.
761
+ *
762
+ * - `{prefix}` - Two hexadecimal digits from the tile's column and row, to spread requests over host names.
763
+ *
764
+ * - `{ratio}` - `@2x` where the device pixel ratio is above 1, empty otherwise.
713
765
  */
714
766
  "tiles"?: Array<string>;
715
767
  /**
@@ -735,7 +787,7 @@ type RasterDEMSourceSpecification = {
735
787
  */
736
788
  "maxzoom"?: number;
737
789
  /**
738
- * The minimum visual size to display tiles for this layer. Only configurable for raster layers.
790
+ * The minimum visual size to display tiles for this source.
739
791
  *
740
792
  * @default
741
793
  * ```json
@@ -743,6 +795,15 @@ type RasterDEMSourceSpecification = {
743
795
  * ```
744
796
  */
745
797
  "tileSize"?: number;
798
+ /**
799
+ * Experimental. What an empty tile response (HTTP 204, or no tile data from an archive such as PMTiles) means in this tileset.
800
+ *
801
+ * @default
802
+ * ```json
803
+ * "blank"
804
+ * ```
805
+ */
806
+ "emptyResponse"?: "blank" | "missing";
746
807
  /**
747
808
  * Contains an attribution to be displayed when the map is shown to a user.
748
809
  */
@@ -876,7 +937,7 @@ type GeoJSONSourceSpecification = {
876
937
  */
877
938
  "clusterProperties"?: unknown;
878
939
  /**
879
- * Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values.
940
+ * Whether to calculate line distance metrics. This is required for line layers that specify [`line-gradient`](layers/#line-gradient) values.
880
941
  */
881
942
  "lineMetrics"?: boolean;
882
943
  /**
@@ -949,7 +1010,7 @@ type FillLayerSpecification = {
949
1010
  */
950
1011
  "maxzoom"?: number;
951
1012
  /**
952
- * 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.
1013
+ * 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.
953
1014
  */
954
1015
  "filter"?: FilterSpecification;
955
1016
  /**
@@ -984,7 +1045,7 @@ type FillLayerSpecification = {
984
1045
  */
985
1046
  "fill-antialias"?: PropertyValueSpecification<boolean>;
986
1047
  /**
987
- * 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.
1048
+ * 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.
988
1049
  *
989
1050
  * @default
990
1051
  * ```json
@@ -994,7 +1055,7 @@ type FillLayerSpecification = {
994
1055
  "fill-opacity"?: DataDrivenPropertyValueSpecification<number>;
995
1056
  "fill-opacity-transition"?: TransitionSpecification;
996
1057
  /**
997
- * 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.
1058
+ * 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.
998
1059
  *
999
1060
  * ![fill-opacity vs. fill-layer-opacity](assets/fill-layer-opacity.svg)
1000
1061
  *
@@ -1005,6 +1066,17 @@ type FillLayerSpecification = {
1005
1066
  */
1006
1067
  "fill-layer-opacity"?: PropertyValueSpecification<number>;
1007
1068
  "fill-layer-opacity-transition"?: TransitionSpecification;
1069
+ /**
1070
+ * 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.
1071
+ *
1072
+ * ![fill-layer-blend examples](assets/fill-layer-blend.svg)
1073
+ *
1074
+ * @default
1075
+ * ```json
1076
+ * "normal"
1077
+ * ```
1078
+ */
1079
+ "fill-layer-blend"?: "normal" | "multiply" | "color" | "luminosity" | "plus-lighter" | "screen" | "overlay";
1008
1080
  /**
1009
1081
  * 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.
1010
1082
  *
@@ -1016,7 +1088,7 @@ type FillLayerSpecification = {
1016
1088
  "fill-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1017
1089
  "fill-color-transition"?: TransitionSpecification;
1018
1090
  /**
1019
- * The outline color of the fill. Matches the value of `fill-color` if unspecified.
1091
+ * The outline color of the fill. Matches the value of [`fill-color`](layers/#fill-color) if unspecified.
1020
1092
  */
1021
1093
  "fill-outline-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
1022
1094
  "fill-outline-color-transition"?: TransitionSpecification;
@@ -1031,7 +1103,7 @@ type FillLayerSpecification = {
1031
1103
  "fill-translate"?: PropertyValueSpecification<[number, number]>;
1032
1104
  "fill-translate-transition"?: TransitionSpecification;
1033
1105
  /**
1034
- * Controls the frame of reference for `fill-translate`.
1106
+ * Controls the frame of reference for [`fill-translate`](layers/#fill-translate).
1035
1107
  *
1036
1108
  * @default
1037
1109
  * ```json
@@ -1078,7 +1150,7 @@ type LineLayerSpecification = {
1078
1150
  */
1079
1151
  "maxzoom"?: number;
1080
1152
  /**
1081
- * 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.
1153
+ * 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.
1082
1154
  */
1083
1155
  "filter"?: FilterSpecification;
1084
1156
  /**
@@ -1150,7 +1222,7 @@ type LineLayerSpecification = {
1150
1222
  "line-opacity"?: DataDrivenPropertyValueSpecification<number>;
1151
1223
  "line-opacity-transition"?: TransitionSpecification;
1152
1224
  /**
1153
- * 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.
1225
+ * 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.
1154
1226
  *
1155
1227
  * ![line-opacity vs. line-layer-opacity](assets/line-layer-opacity.svg)
1156
1228
  *
@@ -1161,6 +1233,17 @@ type LineLayerSpecification = {
1161
1233
  */
1162
1234
  "line-layer-opacity"?: PropertyValueSpecification<number>;
1163
1235
  "line-layer-opacity-transition"?: TransitionSpecification;
1236
+ /**
1237
+ * 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.
1238
+ *
1239
+ * ![line-layer-blend examples](assets/line-layer-blend.svg)
1240
+ *
1241
+ * @default
1242
+ * ```json
1243
+ * "normal"
1244
+ * ```
1245
+ */
1246
+ "line-layer-blend"?: "normal" | "multiply" | "color" | "luminosity" | "plus-lighter" | "screen" | "overlay";
1164
1247
  /**
1165
1248
  * The color with which the line will be drawn.
1166
1249
  *
@@ -1182,7 +1265,7 @@ type LineLayerSpecification = {
1182
1265
  "line-translate"?: PropertyValueSpecification<[number, number]>;
1183
1266
  "line-translate-transition"?: TransitionSpecification;
1184
1267
  /**
1185
- * Controls the frame of reference for `line-translate`.
1268
+ * Controls the frame of reference for [`line-translate`](layers/#line-translate).
1186
1269
  *
1187
1270
  * @default
1188
1271
  * ```json
@@ -1263,7 +1346,7 @@ type SymbolLayerSpecification = {
1263
1346
  */
1264
1347
  "maxzoom"?: number;
1265
1348
  /**
1266
- * 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.
1349
+ * 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.
1267
1350
  */
1268
1351
  "filter"?: FilterSpecification;
1269
1352
  /**
@@ -1293,11 +1376,11 @@ type SymbolLayerSpecification = {
1293
1376
  */
1294
1377
  "symbol-avoid-edges"?: PropertyValueSpecification<boolean>;
1295
1378
  /**
1296
- * 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.
1379
+ * 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.
1297
1380
  */
1298
1381
  "symbol-sort-key"?: DataDrivenPropertyValueSpecification<number>;
1299
1382
  /**
1300
- * 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`.
1383
+ * 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).
1301
1384
  *
1302
1385
  * @default
1303
1386
  * ```json
@@ -1310,7 +1393,7 @@ type SymbolLayerSpecification = {
1310
1393
  */
1311
1394
  "icon-allow-overlap"?: PropertyValueSpecification<boolean>;
1312
1395
  /**
1313
- * 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.
1396
+ * 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.
1314
1397
  */
1315
1398
  "icon-overlap"?: PropertyValueSpecification<"never" | "always" | "cooperative">;
1316
1399
  /**
@@ -1322,7 +1405,7 @@ type SymbolLayerSpecification = {
1322
1405
  */
1323
1406
  "icon-optional"?: PropertyValueSpecification<boolean>;
1324
1407
  /**
1325
- * In combination with `symbol-placement`, determines the rotation behavior of icons.
1408
+ * In combination with [`symbol-placement`](layers/#symbol-placement), determines the rotation behavior of icons.
1326
1409
  *
1327
1410
  * @default
1328
1411
  * ```json
@@ -1349,7 +1432,7 @@ type SymbolLayerSpecification = {
1349
1432
  */
1350
1433
  "icon-text-fit"?: PropertyValueSpecification<"none" | "width" | "height" | "both">;
1351
1434
  /**
1352
- * Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.
1435
+ * Size of the additional area added to dimensions determined by [`icon-text-fit`](layers/#icon-text-fit), in clockwise order: top, right, bottom, left.
1353
1436
  *
1354
1437
  * @default
1355
1438
  * ```json
@@ -1379,7 +1462,7 @@ type SymbolLayerSpecification = {
1379
1462
  */
1380
1463
  "icon-keep-upright"?: PropertyValueSpecification<boolean>;
1381
1464
  /**
1382
- * 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.
1465
+ * 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.
1383
1466
  *
1384
1467
  * @default
1385
1468
  * ```json
@@ -1415,7 +1498,7 @@ type SymbolLayerSpecification = {
1415
1498
  */
1416
1499
  "text-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
1417
1500
  /**
1418
- * In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
1501
+ * In combination with [`symbol-placement`](layers/#symbol-placement), determines the rotation behavior of the individual glyphs forming the text.
1419
1502
  *
1420
1503
  * @default
1421
1504
  * ```json
@@ -1477,11 +1560,11 @@ type SymbolLayerSpecification = {
1477
1560
  */
1478
1561
  "text-justify"?: DataDrivenPropertyValueSpecification<"auto" | "left" | "center" | "right">;
1479
1562
  /**
1480
- * 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.
1563
+ * 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.
1481
1564
  */
1482
1565
  "text-radial-offset"?: DataDrivenPropertyValueSpecification<number>;
1483
1566
  /**
1484
- * 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`.
1567
+ * 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).
1485
1568
  *
1486
1569
  * @example
1487
1570
  * ```json
@@ -1490,11 +1573,11 @@ type SymbolLayerSpecification = {
1490
1573
  */
1491
1574
  "text-variable-anchor"?: PropertyValueSpecification<Array<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">>;
1492
1575
  /**
1493
- * 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.
1576
+ * 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.
1494
1577
  *
1495
1578
  * 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.
1496
1579
  *
1497
- * When present, this property takes precedence over `text-anchor`, `text-variable-anchor`, `text-offset`, and `text-radial-offset`.
1580
+ * 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).
1498
1581
  *
1499
1582
  * ```json
1500
1583
  *
@@ -1579,7 +1662,7 @@ type SymbolLayerSpecification = {
1579
1662
  */
1580
1663
  "text-allow-overlap"?: PropertyValueSpecification<boolean>;
1581
1664
  /**
1582
- * 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
1665
+ * 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
1583
1666
  */
1584
1667
  "text-overlap"?: PropertyValueSpecification<"never" | "always" | "cooperative">;
1585
1668
  /**
@@ -1591,11 +1674,11 @@ type SymbolLayerSpecification = {
1591
1674
  */
1592
1675
  "text-optional"?: PropertyValueSpecification<boolean>;
1593
1676
  /**
1594
- * 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.
1677
+ * 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.
1595
1678
  */
1596
1679
  "symbol-height-offset"?: DataDrivenPropertyValueSpecification<number>;
1597
1680
  /**
1598
- * Defines what `symbol-height-offset` is measured from.
1681
+ * Defines what [`symbol-height-offset`](layers/#symbol-height-offset) is measured from.
1599
1682
  *
1600
1683
  * @default
1601
1684
  * ```json
@@ -1670,7 +1753,7 @@ type SymbolLayerSpecification = {
1670
1753
  "icon-translate"?: PropertyValueSpecification<[number, number]>;
1671
1754
  "icon-translate-transition"?: TransitionSpecification;
1672
1755
  /**
1673
- * Controls the frame of reference for `icon-translate`.
1756
+ * Controls the frame of reference for [`icon-translate`](layers/#icon-translate).
1674
1757
  *
1675
1758
  * @default
1676
1759
  * ```json
@@ -1729,7 +1812,7 @@ type SymbolLayerSpecification = {
1729
1812
  "text-translate"?: PropertyValueSpecification<[number, number]>;
1730
1813
  "text-translate-transition"?: TransitionSpecification;
1731
1814
  /**
1732
- * Controls the frame of reference for `text-translate`.
1815
+ * Controls the frame of reference for [`text-translate`](layers/#text-translate).
1733
1816
  *
1734
1817
  * @default
1735
1818
  * ```json
@@ -1771,7 +1854,7 @@ type CircleLayerSpecification = {
1771
1854
  */
1772
1855
  "maxzoom"?: number;
1773
1856
  /**
1774
- * 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.
1857
+ * 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.
1775
1858
  */
1776
1859
  "filter"?: FilterSpecification;
1777
1860
  /**
@@ -1842,7 +1925,7 @@ type CircleLayerSpecification = {
1842
1925
  "circle-translate"?: PropertyValueSpecification<[number, number]>;
1843
1926
  "circle-translate-transition"?: TransitionSpecification;
1844
1927
  /**
1845
- * Controls the frame of reference for `circle-translate`.
1928
+ * Controls the frame of reference for [`circle-translate`](layers/#circle-translate).
1846
1929
  *
1847
1930
  * @default
1848
1931
  * ```json
@@ -1869,7 +1952,7 @@ type CircleLayerSpecification = {
1869
1952
  */
1870
1953
  "circle-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport">;
1871
1954
  /**
1872
- * The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.
1955
+ * The width of the circle's stroke. Strokes are placed outside of the [`circle-radius`](layers/#circle-radius).
1873
1956
  */
1874
1957
  "circle-stroke-width"?: DataDrivenPropertyValueSpecification<number>;
1875
1958
  "circle-stroke-width-transition"?: TransitionSpecification;
@@ -1927,7 +2010,7 @@ type HeatmapLayerSpecification = {
1927
2010
  */
1928
2011
  "maxzoom"?: number;
1929
2012
  /**
1930
- * 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.
2013
+ * 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.
1931
2014
  */
1932
2015
  "filter"?: FilterSpecification;
1933
2016
  /**
@@ -1968,7 +2051,7 @@ type HeatmapLayerSpecification = {
1968
2051
  */
1969
2052
  "heatmap-weight"?: DataDrivenPropertyValueSpecification<number>;
1970
2053
  /**
1971
- * Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.
2054
+ * 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.
1972
2055
  *
1973
2056
  * @default
1974
2057
  * ```json
@@ -2046,7 +2129,7 @@ type FillExtrusionLayerSpecification = {
2046
2129
  */
2047
2130
  "maxzoom"?: number;
2048
2131
  /**
2049
- * 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.
2132
+ * 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.
2050
2133
  */
2051
2134
  "filter"?: FilterSpecification;
2052
2135
  /**
@@ -2082,7 +2165,7 @@ type FillExtrusionLayerSpecification = {
2082
2165
  "fill-extrusion-opacity"?: PropertyValueSpecification<number>;
2083
2166
  "fill-extrusion-opacity-transition"?: TransitionSpecification;
2084
2167
  /**
2085
- * 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.
2168
+ * 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.
2086
2169
  *
2087
2170
  * @default
2088
2171
  * ```json
@@ -2102,7 +2185,7 @@ type FillExtrusionLayerSpecification = {
2102
2185
  "fill-extrusion-translate"?: PropertyValueSpecification<[number, number]>;
2103
2186
  "fill-extrusion-translate-transition"?: TransitionSpecification;
2104
2187
  /**
2105
- * Controls the frame of reference for `fill-extrusion-translate`.
2188
+ * Controls the frame of reference for [`fill-extrusion-translate`](layers/#fill-extrusion-translate).
2106
2189
  *
2107
2190
  * @default
2108
2191
  * ```json
@@ -2121,7 +2204,7 @@ type FillExtrusionLayerSpecification = {
2121
2204
  "fill-extrusion-height"?: DataDrivenPropertyValueSpecification<number>;
2122
2205
  "fill-extrusion-height-transition"?: TransitionSpecification;
2123
2206
  /**
2124
- * 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.
2207
+ * 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.
2125
2208
  */
2126
2209
  "fill-extrusion-base"?: DataDrivenPropertyValueSpecification<number>;
2127
2210
  "fill-extrusion-base-transition"?: TransitionSpecification;
@@ -2168,7 +2251,7 @@ type RasterLayerSpecification = {
2168
2251
  */
2169
2252
  "maxzoom"?: number;
2170
2253
  /**
2171
- * 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.
2254
+ * 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.
2172
2255
  */
2173
2256
  "filter"?: FilterSpecification;
2174
2257
  /**
@@ -2199,6 +2282,15 @@ type RasterLayerSpecification = {
2199
2282
  */
2200
2283
  "raster-opacity"?: PropertyValueSpecification<number>;
2201
2284
  "raster-opacity-transition"?: TransitionSpecification;
2285
+ /**
2286
+ * Controls how the layer is composited with the content already rendered beneath it. Unlike [`raster-opacity`](#raster-opacity), which only fades the layer, this property determines how its colors interact with the existing map contents.
2287
+ *
2288
+ * @default
2289
+ * ```json
2290
+ * "normal"
2291
+ * ```
2292
+ */
2293
+ "raster-layer-blend"?: "normal" | "multiply" | "color" | "luminosity" | "plus-lighter" | "screen" | "overlay";
2202
2294
  /**
2203
2295
  * Rotates hues around the color wheel.
2204
2296
  */
@@ -2291,7 +2383,7 @@ type HillshadeLayerSpecification = {
2291
2383
  */
2292
2384
  "maxzoom"?: number;
2293
2385
  /**
2294
- * 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.
2386
+ * 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.
2295
2387
  */
2296
2388
  "filter"?: FilterSpecification;
2297
2389
  /**
@@ -2313,7 +2405,7 @@ type HillshadeLayerSpecification = {
2313
2405
  */
2314
2406
  "paint"?: {
2315
2407
  /**
2316
- * 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.
2408
+ * 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.
2317
2409
  *
2318
2410
  * @default
2319
2411
  * ```json
@@ -2322,7 +2414,7 @@ type HillshadeLayerSpecification = {
2322
2414
  */
2323
2415
  "hillshade-illumination-direction"?: PropertyValueSpecification<NumberArraySpecification>;
2324
2416
  /**
2325
- * 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.
2417
+ * 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.
2326
2418
  *
2327
2419
  * @default
2328
2420
  * ```json
@@ -2350,7 +2442,7 @@ type HillshadeLayerSpecification = {
2350
2442
  "hillshade-exaggeration"?: PropertyValueSpecification<number>;
2351
2443
  "hillshade-exaggeration-transition"?: TransitionSpecification;
2352
2444
  /**
2353
- * 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.
2445
+ * 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.
2354
2446
  *
2355
2447
  * @default
2356
2448
  * ```json
@@ -2360,7 +2452,7 @@ type HillshadeLayerSpecification = {
2360
2452
  "hillshade-shadow-color"?: PropertyValueSpecification<ColorArraySpecification>;
2361
2453
  "hillshade-shadow-color-transition"?: TransitionSpecification;
2362
2454
  /**
2363
- * 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.
2455
+ * 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.
2364
2456
  *
2365
2457
  * @default
2366
2458
  * ```json
@@ -2433,7 +2525,7 @@ type ColorReliefLayerSpecification = {
2433
2525
  */
2434
2526
  "maxzoom"?: number;
2435
2527
  /**
2436
- * 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.
2528
+ * 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.
2437
2529
  */
2438
2530
  "filter"?: FilterSpecification;
2439
2531
  /**
@@ -2465,7 +2557,7 @@ type ColorReliefLayerSpecification = {
2465
2557
  "color-relief-opacity"?: PropertyValueSpecification<number>;
2466
2558
  "color-relief-opacity-transition"?: TransitionSpecification;
2467
2559
  /**
2468
- * Defines the color of each pixel based on its elevation. Should be an expression that uses `["elevation"]` as input.
2560
+ * Defines the color of each pixel based on its elevation. Should be an expression that uses the [`elevation`](expressions/#elevation) expression as input.
2469
2561
  *
2470
2562
  * @example
2471
2563
  * ```json
@@ -2562,8 +2654,6 @@ type BackgroundLayerSpecification = {
2562
2654
  };
2563
2655
  };
2564
2656
  type LayerSpecification = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | RasterLayerSpecification | HillshadeLayerSpecification | ColorReliefLayerSpecification | BackgroundLayerSpecification;
2565
- //#endregion
2566
- //#region src/expression/types/color_spaces.d.ts
2567
2657
  /**
2568
2658
  * @param r Red component 0..1
2569
2659
  * @param g Green component 0..1
@@ -2585,8 +2675,6 @@ type HCLColor = [h: number, c: number, l: number, alpha: number];
2585
2675
  * @param alpha Alpha component 0..1
2586
2676
  */
2587
2677
  type LABColor = [l: number, a: number, b: number, alpha: number];
2588
- //#endregion
2589
- //#region src/expression/types/color.d.ts
2590
2678
  type InterpolationColorSpace = 'rgb' | 'hcl' | 'lab';
2591
2679
  /**
2592
2680
  * Color representation used by WebGL.
@@ -2677,14 +2765,10 @@ declare class Color {
2677
2765
  toString(): string;
2678
2766
  static interpolate(from: Color, to: Color, t: number, spaceKey?: InterpolationColorSpace): Color;
2679
2767
  }
2680
- //#endregion
2681
- //#region src/point2d.d.ts
2682
2768
  interface Point2D$1 {
2683
2769
  x: number;
2684
2770
  y: number;
2685
2771
  }
2686
- //#endregion
2687
- //#region src/expression/index.d.ts
2688
2772
  type Feature$1 = {
2689
2773
  readonly type: 0 | 1 | 2 | 3 | 'Unknown' | 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon';
2690
2774
  readonly id?: any;
@@ -3092,6 +3176,32 @@ interface FetchRequestInit {
3092
3176
  */
3093
3177
  type FetchFunction = (url: string, init?: FetchRequestInit) => Promise<FetchResponse>;
3094
3178
 
3179
+ /**
3180
+ * An image that the style uses besides those of its sprite, as MapLibre GL JS takes it with
3181
+ * `map.addImage(id, { width, height, data }, { pixelRatio, sdf })`.
3182
+ */
3183
+ interface StyleImage {
3184
+ /** The name that the style uses, e.g. in `icon-image` or `fill-pattern`. No sprite id is put before it. */
3185
+ id: string;
3186
+ /** Width in pixels. */
3187
+ width: number;
3188
+ /** Height in pixels. */
3189
+ height: number;
3190
+ /** The pixels as RGBA, row by row, not premultiplied: `width * height * 4` bytes. */
3191
+ data: Uint8Array | Uint8ClampedArray;
3192
+ /**
3193
+ * Image pixels per pixel of the map, e.g. `2` for an image drawn at half its size.
3194
+ * @defaultValue `1`
3195
+ */
3196
+ pixelRatio?: number;
3197
+ /**
3198
+ * Whether the image is a signed distance field, as a sprite image can be: only its alpha
3199
+ * channel counts, and `icon-color` and the icon halo color it.
3200
+ * @defaultValue `false`
3201
+ */
3202
+ sdf?: boolean;
3203
+ }
3204
+
3095
3205
  /** Options for {@link SVGMapRenderer}: what stays the same for every view of the map. */
3096
3206
  interface SVGMapRendererOptions {
3097
3207
  /**
@@ -3178,6 +3288,19 @@ interface SVGMapRendererOptions {
3178
3288
  * @defaultValue the defaults of the style's `state`
3179
3289
  */
3180
3290
  globalState?: GlobalState;
3291
+ /**
3292
+ * Images that the style uses besides those of its sprite, like `map.addImage(id, image,
3293
+ * { pixelRatio, sdf })` in MapLibre GL JS: for `icon-image`, `fill-pattern`, `line-pattern`
3294
+ * and `background-pattern`, by their `id`, which no sprite id is put before. An SDF image is
3295
+ * colored by `icon-color` and its halo, like one of the sprite.
3296
+ *
3297
+ * As in MapLibre GL JS, where `addImage` fails for an id that exists, an image of the sprite
3298
+ * with the same id is drawn instead, reported through
3299
+ * {@link SVGMapRendererOptions.onWarning}. In an SVG, each image is a data URI of a PNG file
3300
+ * without compression.
3301
+ * @defaultValue none
3302
+ */
3303
+ images?: readonly StyleImage[];
3181
3304
  }
3182
3305
  /** The view to render: size, centre and zoom. */
3183
3306
  interface ViewOptions {
@@ -3525,4 +3648,4 @@ declare class PNGMapRenderer extends SVGMapRenderer {
3525
3648
  }
3526
3649
 
3527
3650
  export { PNGMapRenderer, SVGMapRenderer, renderToCanvas, renderToPNG, renderToSVG };
3528
- export type { FetchFunction, FetchRequestInit, FetchResponse, GlobalState, PNGMapRendererOptions, PNGViewOptions, RenderToPNGOptions, RenderToSVGOptions, SVGMapRendererOptions, ViewOptions };
3651
+ export type { FetchFunction, FetchRequestInit, FetchResponse, GlobalState, PNGMapRendererOptions, PNGViewOptions, RenderToPNGOptions, RenderToSVGOptions, SVGMapRendererOptions, StyleImage, ViewOptions };