@versatiles/svg-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/README.md +38 -22
- package/dist/index.d.ts +185 -62
- package/dist/index.js +1068 -820
- 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`](
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
* 
|
|
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
|
+
* 
|
|
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
|
|
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
|
* 
|
|
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
|
+
* 
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
/**
|
|
@@ -2196,6 +2279,15 @@ type RasterLayerSpecification = {
|
|
|
2196
2279
|
*/
|
|
2197
2280
|
"raster-opacity"?: PropertyValueSpecification<number>;
|
|
2198
2281
|
"raster-opacity-transition"?: TransitionSpecification;
|
|
2282
|
+
/**
|
|
2283
|
+
* 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.
|
|
2284
|
+
*
|
|
2285
|
+
* @default
|
|
2286
|
+
* ```json
|
|
2287
|
+
* "normal"
|
|
2288
|
+
* ```
|
|
2289
|
+
*/
|
|
2290
|
+
"raster-layer-blend"?: "normal" | "multiply" | "color" | "luminosity" | "plus-lighter" | "screen" | "overlay";
|
|
2199
2291
|
/**
|
|
2200
2292
|
* Rotates hues around the color wheel.
|
|
2201
2293
|
*/
|
|
@@ -2288,7 +2380,7 @@ type HillshadeLayerSpecification = {
|
|
|
2288
2380
|
*/
|
|
2289
2381
|
"maxzoom"?: number;
|
|
2290
2382
|
/**
|
|
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.
|
|
2383
|
+
* 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
2384
|
*/
|
|
2293
2385
|
"filter"?: FilterSpecification;
|
|
2294
2386
|
/**
|
|
@@ -2310,7 +2402,7 @@ type HillshadeLayerSpecification = {
|
|
|
2310
2402
|
*/
|
|
2311
2403
|
"paint"?: {
|
|
2312
2404
|
/**
|
|
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.
|
|
2405
|
+
* 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
2406
|
*
|
|
2315
2407
|
* @default
|
|
2316
2408
|
* ```json
|
|
@@ -2319,7 +2411,7 @@ type HillshadeLayerSpecification = {
|
|
|
2319
2411
|
*/
|
|
2320
2412
|
"hillshade-illumination-direction"?: PropertyValueSpecification<NumberArraySpecification>;
|
|
2321
2413
|
/**
|
|
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.
|
|
2414
|
+
* 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
2415
|
*
|
|
2324
2416
|
* @default
|
|
2325
2417
|
* ```json
|
|
@@ -2347,7 +2439,7 @@ type HillshadeLayerSpecification = {
|
|
|
2347
2439
|
"hillshade-exaggeration"?: PropertyValueSpecification<number>;
|
|
2348
2440
|
"hillshade-exaggeration-transition"?: TransitionSpecification;
|
|
2349
2441
|
/**
|
|
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.
|
|
2442
|
+
* 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
2443
|
*
|
|
2352
2444
|
* @default
|
|
2353
2445
|
* ```json
|
|
@@ -2357,7 +2449,7 @@ type HillshadeLayerSpecification = {
|
|
|
2357
2449
|
"hillshade-shadow-color"?: PropertyValueSpecification<ColorArraySpecification>;
|
|
2358
2450
|
"hillshade-shadow-color-transition"?: TransitionSpecification;
|
|
2359
2451
|
/**
|
|
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.
|
|
2452
|
+
* 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
2453
|
*
|
|
2362
2454
|
* @default
|
|
2363
2455
|
* ```json
|
|
@@ -2430,7 +2522,7 @@ type ColorReliefLayerSpecification = {
|
|
|
2430
2522
|
*/
|
|
2431
2523
|
"maxzoom"?: number;
|
|
2432
2524
|
/**
|
|
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.
|
|
2525
|
+
* 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
2526
|
*/
|
|
2435
2527
|
"filter"?: FilterSpecification;
|
|
2436
2528
|
/**
|
|
@@ -2462,7 +2554,7 @@ type ColorReliefLayerSpecification = {
|
|
|
2462
2554
|
"color-relief-opacity"?: PropertyValueSpecification<number>;
|
|
2463
2555
|
"color-relief-opacity-transition"?: TransitionSpecification;
|
|
2464
2556
|
/**
|
|
2465
|
-
* Defines the color of each pixel based on its elevation. Should be an expression that uses `
|
|
2557
|
+
* Defines the color of each pixel based on its elevation. Should be an expression that uses the [`elevation`](expressions/#elevation) expression as input.
|
|
2466
2558
|
*
|
|
2467
2559
|
* @example
|
|
2468
2560
|
* ```json
|
|
@@ -2559,8 +2651,6 @@ type BackgroundLayerSpecification = {
|
|
|
2559
2651
|
};
|
|
2560
2652
|
};
|
|
2561
2653
|
type LayerSpecification = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | RasterLayerSpecification | HillshadeLayerSpecification | ColorReliefLayerSpecification | BackgroundLayerSpecification;
|
|
2562
|
-
//#endregion
|
|
2563
|
-
//#region src/expression/types/color_spaces.d.ts
|
|
2564
2654
|
/**
|
|
2565
2655
|
* @param r Red component 0..1
|
|
2566
2656
|
* @param g Green component 0..1
|
|
@@ -2582,8 +2672,6 @@ type HCLColor = [h: number, c: number, l: number, alpha: number];
|
|
|
2582
2672
|
* @param alpha Alpha component 0..1
|
|
2583
2673
|
*/
|
|
2584
2674
|
type LABColor = [l: number, a: number, b: number, alpha: number];
|
|
2585
|
-
//#endregion
|
|
2586
|
-
//#region src/expression/types/color.d.ts
|
|
2587
2675
|
type InterpolationColorSpace = 'rgb' | 'hcl' | 'lab';
|
|
2588
2676
|
/**
|
|
2589
2677
|
* Color representation used by WebGL.
|
|
@@ -2674,14 +2762,10 @@ declare class Color {
|
|
|
2674
2762
|
toString(): string;
|
|
2675
2763
|
static interpolate(from: Color, to: Color, t: number, spaceKey?: InterpolationColorSpace): Color;
|
|
2676
2764
|
}
|
|
2677
|
-
//#endregion
|
|
2678
|
-
//#region src/point2d.d.ts
|
|
2679
2765
|
interface Point2D$1 {
|
|
2680
2766
|
x: number;
|
|
2681
2767
|
y: number;
|
|
2682
2768
|
}
|
|
2683
|
-
//#endregion
|
|
2684
|
-
//#region src/expression/index.d.ts
|
|
2685
2769
|
type Feature$1 = {
|
|
2686
2770
|
readonly type: 0 | 1 | 2 | 3 | 'Unknown' | 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon';
|
|
2687
2771
|
readonly id?: any;
|
|
@@ -3089,6 +3173,32 @@ interface FetchRequestInit {
|
|
|
3089
3173
|
*/
|
|
3090
3174
|
type FetchFunction = (url: string, init?: FetchRequestInit) => Promise<FetchResponse>;
|
|
3091
3175
|
|
|
3176
|
+
/**
|
|
3177
|
+
* An image that the style uses besides those of its sprite, as MapLibre GL JS takes it with
|
|
3178
|
+
* `map.addImage(id, { width, height, data }, { pixelRatio, sdf })`.
|
|
3179
|
+
*/
|
|
3180
|
+
interface StyleImage {
|
|
3181
|
+
/** The name that the style uses, e.g. in `icon-image` or `fill-pattern`. No sprite id is put before it. */
|
|
3182
|
+
id: string;
|
|
3183
|
+
/** Width in pixels. */
|
|
3184
|
+
width: number;
|
|
3185
|
+
/** Height in pixels. */
|
|
3186
|
+
height: number;
|
|
3187
|
+
/** The pixels as RGBA, row by row, not premultiplied: `width * height * 4` bytes. */
|
|
3188
|
+
data: Uint8Array | Uint8ClampedArray;
|
|
3189
|
+
/**
|
|
3190
|
+
* Image pixels per pixel of the map, e.g. `2` for an image drawn at half its size.
|
|
3191
|
+
* @defaultValue `1`
|
|
3192
|
+
*/
|
|
3193
|
+
pixelRatio?: number;
|
|
3194
|
+
/**
|
|
3195
|
+
* Whether the image is a signed distance field, as a sprite image can be: only its alpha
|
|
3196
|
+
* channel counts, and `icon-color` and the icon halo color it.
|
|
3197
|
+
* @defaultValue `false`
|
|
3198
|
+
*/
|
|
3199
|
+
sdf?: boolean;
|
|
3200
|
+
}
|
|
3201
|
+
|
|
3092
3202
|
/** Options for {@link SVGMapRenderer}: what stays the same for every view of the map. */
|
|
3093
3203
|
interface SVGMapRendererOptions {
|
|
3094
3204
|
/**
|
|
@@ -3175,6 +3285,19 @@ interface SVGMapRendererOptions {
|
|
|
3175
3285
|
* @defaultValue the defaults of the style's `state`
|
|
3176
3286
|
*/
|
|
3177
3287
|
globalState?: GlobalState;
|
|
3288
|
+
/**
|
|
3289
|
+
* Images that the style uses besides those of its sprite, like `map.addImage(id, image,
|
|
3290
|
+
* { pixelRatio, sdf })` in MapLibre GL JS: for `icon-image`, `fill-pattern`, `line-pattern`
|
|
3291
|
+
* and `background-pattern`, by their `id`, which no sprite id is put before. An SDF image is
|
|
3292
|
+
* colored by `icon-color` and its halo, like one of the sprite.
|
|
3293
|
+
*
|
|
3294
|
+
* As in MapLibre GL JS, where `addImage` fails for an id that exists, an image of the sprite
|
|
3295
|
+
* with the same id is drawn instead, reported through
|
|
3296
|
+
* {@link SVGMapRendererOptions.onWarning}. In an SVG, each image is a data URI of a PNG file
|
|
3297
|
+
* without compression.
|
|
3298
|
+
* @defaultValue none
|
|
3299
|
+
*/
|
|
3300
|
+
images?: readonly StyleImage[];
|
|
3178
3301
|
}
|
|
3179
3302
|
/** The view to render: size, centre and zoom. */
|
|
3180
3303
|
interface ViewOptions {
|
|
@@ -3350,4 +3473,4 @@ interface RenderToSVGOptions extends Omit<SVGMapRendererOptions, 'tileCacheSize'
|
|
|
3350
3473
|
declare function renderToSVG(options: RenderToSVGOptions): Promise<string>;
|
|
3351
3474
|
|
|
3352
3475
|
export { SVGMapRenderer, renderToSVG };
|
|
3353
|
-
export type { FetchFunction, FetchRequestInit, FetchResponse, GlobalState, RenderToSVGOptions, SVGMapRendererOptions, ViewOptions };
|
|
3476
|
+
export type { FetchFunction, FetchRequestInit, FetchResponse, GlobalState, RenderToSVGOptions, SVGMapRendererOptions, StyleImage, ViewOptions };
|