@mapbox/mapbox-gl-style-spec 14.11.0 → 14.12.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/composite.ts +2 -0
- package/deref.ts +5 -5
- package/diff.ts +65 -31
- package/dist/index.cjs +816 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +224 -16
- package/dist/index.es.js +816 -16
- package/dist/index.es.js.map +1 -1
- package/error/validation_error.ts +1 -3
- package/expression/compound_expression.ts +1 -1
- package/expression/definitions/assertion.ts +2 -1
- package/expression/definitions/at.ts +1 -1
- package/expression/definitions/at_interpolated.ts +1 -1
- package/expression/definitions/case.ts +3 -1
- package/expression/definitions/coalesce.ts +3 -2
- package/expression/definitions/coercion.ts +3 -1
- package/expression/definitions/collator.ts +2 -1
- package/expression/definitions/comparison.ts +15 -1
- package/expression/definitions/config.ts +4 -1
- package/expression/definitions/distance.ts +6 -4
- package/expression/definitions/format.ts +1 -1
- package/expression/definitions/index.ts +24 -2
- package/expression/definitions/index_of.ts +1 -0
- package/expression/definitions/interpolate.ts +7 -3
- package/expression/definitions/let.ts +1 -0
- package/expression/definitions/literal.ts +2 -2
- package/expression/definitions/match.ts +4 -2
- package/expression/definitions/number_format.ts +3 -4
- package/expression/definitions/slice.ts +1 -0
- package/expression/definitions/step.ts +2 -1
- package/expression/definitions/var.ts +1 -0
- package/expression/definitions/within.ts +6 -2
- package/expression/evaluation_context.ts +3 -5
- package/expression/expression.ts +3 -0
- package/expression/index.ts +20 -10
- package/expression/parsing_context.ts +1 -1
- package/expression/types/image_variant.ts +2 -2
- package/expression/types.ts +1 -0
- package/expression/values.ts +1 -3
- package/feature_filter/convert.ts +13 -6
- package/feature_filter/index.ts +17 -1
- package/format.ts +1 -0
- package/function/convert.ts +5 -1
- package/function/index.ts +28 -0
- package/group_by_layout.ts +17 -8
- package/migrate/expressions.ts +3 -3
- package/migrate/v8.ts +10 -1
- package/migrate/v9.ts +2 -1
- package/migrate.ts +2 -1
- package/package.json +1 -1
- package/read_style.ts +1 -0
- package/reference/latest.ts +1 -0
- package/reference/v8.json +425 -8
- package/test.js +2 -4
- package/types.ts +207 -1
- package/union-to-intersection.ts +1 -0
- package/util/extend.ts +2 -1
- package/util/geometry_util.ts +25 -9
- package/util/interpolate.ts +1 -1
- package/validate/validate.ts +6 -0
- package/validate/validate_array.ts +2 -0
- package/validate/validate_enum.ts +1 -0
- package/validate/validate_expression.ts +4 -0
- package/validate/validate_filter.ts +4 -2
- package/validate/validate_fog.ts +4 -1
- package/validate/validate_function.ts +7 -2
- package/validate/validate_glyphs_url.ts +1 -1
- package/validate/validate_iconset.ts +1 -0
- package/validate/validate_layer.ts +3 -2
- package/validate/validate_light.ts +4 -1
- package/validate/validate_lights.ts +7 -1
- package/validate/validate_model.ts +4 -0
- package/validate/validate_object.ts +2 -2
- package/validate/validate_projection.ts +1 -0
- package/validate/validate_property.ts +5 -1
- package/validate/validate_rain.ts +3 -0
- package/validate/validate_snow.ts +3 -0
- package/validate/validate_source.ts +9 -9
- package/validate/validate_terrain.ts +5 -1
- package/validate_mapbox_api_supported.ts +31 -20
- package/validate_style.ts +1 -0
- package/visit.ts +4 -2
package/dist/index.cjs
CHANGED
|
@@ -794,6 +794,16 @@
|
|
|
794
794
|
],
|
|
795
795
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
796
796
|
},
|
|
797
|
+
extra_bounds: {
|
|
798
|
+
type: "array",
|
|
799
|
+
value: {
|
|
800
|
+
type: "array",
|
|
801
|
+
value: "number",
|
|
802
|
+
length: 4,
|
|
803
|
+
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
804
|
+
},
|
|
805
|
+
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
806
|
+
},
|
|
797
807
|
scheme: {
|
|
798
808
|
type: "enum",
|
|
799
809
|
values: {
|
|
@@ -873,6 +883,16 @@
|
|
|
873
883
|
],
|
|
874
884
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
875
885
|
},
|
|
886
|
+
extra_bounds: {
|
|
887
|
+
type: "array",
|
|
888
|
+
value: {
|
|
889
|
+
type: "array",
|
|
890
|
+
value: "number",
|
|
891
|
+
length: 4,
|
|
892
|
+
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
893
|
+
},
|
|
894
|
+
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
895
|
+
},
|
|
876
896
|
minzoom: {
|
|
877
897
|
type: "number",
|
|
878
898
|
"default": 0,
|
|
@@ -954,6 +974,16 @@
|
|
|
954
974
|
],
|
|
955
975
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
956
976
|
},
|
|
977
|
+
extra_bounds: {
|
|
978
|
+
type: "array",
|
|
979
|
+
value: {
|
|
980
|
+
type: "array",
|
|
981
|
+
value: "number",
|
|
982
|
+
length: 4,
|
|
983
|
+
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
984
|
+
},
|
|
985
|
+
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
986
|
+
},
|
|
957
987
|
minzoom: {
|
|
958
988
|
type: "number",
|
|
959
989
|
"default": 0,
|
|
@@ -1036,6 +1066,16 @@
|
|
|
1036
1066
|
],
|
|
1037
1067
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
1038
1068
|
},
|
|
1069
|
+
extra_bounds: {
|
|
1070
|
+
type: "array",
|
|
1071
|
+
value: {
|
|
1072
|
+
type: "array",
|
|
1073
|
+
value: "number",
|
|
1074
|
+
length: 4,
|
|
1075
|
+
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
1076
|
+
},
|
|
1077
|
+
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
1078
|
+
},
|
|
1039
1079
|
minzoom: {
|
|
1040
1080
|
type: "number",
|
|
1041
1081
|
"default": 0,
|
|
@@ -1327,6 +1367,13 @@
|
|
|
1327
1367
|
}
|
|
1328
1368
|
}
|
|
1329
1369
|
},
|
|
1370
|
+
building: {
|
|
1371
|
+
doc: "A procedural 3D building.",
|
|
1372
|
+
"sdk-support": {
|
|
1373
|
+
},
|
|
1374
|
+
experimental: true,
|
|
1375
|
+
"private": true
|
|
1376
|
+
},
|
|
1330
1377
|
raster: {
|
|
1331
1378
|
doc: "Raster map textures such as satellite imagery.",
|
|
1332
1379
|
"sdk-support": {
|
|
@@ -1468,6 +1515,7 @@
|
|
|
1468
1515
|
"layout_circle",
|
|
1469
1516
|
"layout_heatmap",
|
|
1470
1517
|
"layout_fill-extrusion",
|
|
1518
|
+
"layout_building",
|
|
1471
1519
|
"layout_symbol",
|
|
1472
1520
|
"layout_raster",
|
|
1473
1521
|
"layout_raster-particle",
|
|
@@ -1865,6 +1913,115 @@
|
|
|
1865
1913
|
"property-type": "constant"
|
|
1866
1914
|
}
|
|
1867
1915
|
};
|
|
1916
|
+
var layout_building = {
|
|
1917
|
+
visibility: {
|
|
1918
|
+
type: "enum",
|
|
1919
|
+
values: {
|
|
1920
|
+
visible: {
|
|
1921
|
+
doc: "The layer is shown."
|
|
1922
|
+
},
|
|
1923
|
+
none: {
|
|
1924
|
+
doc: "The layer is not shown."
|
|
1925
|
+
}
|
|
1926
|
+
},
|
|
1927
|
+
"default": "visible",
|
|
1928
|
+
doc: "Whether this layer is displayed.",
|
|
1929
|
+
"sdk-support": {
|
|
1930
|
+
"basic functionality": {
|
|
1931
|
+
}
|
|
1932
|
+
},
|
|
1933
|
+
expression: {
|
|
1934
|
+
interpolated: false
|
|
1935
|
+
},
|
|
1936
|
+
"property-type": "constant"
|
|
1937
|
+
},
|
|
1938
|
+
"building-roof-shape": {
|
|
1939
|
+
type: "enum",
|
|
1940
|
+
values: {
|
|
1941
|
+
flat: {
|
|
1942
|
+
doc: "Use regular extruded buildings with flat roofs."
|
|
1943
|
+
},
|
|
1944
|
+
hipped: {
|
|
1945
|
+
doc: "Use hipped roof for the procedurally generated buildings."
|
|
1946
|
+
},
|
|
1947
|
+
gabled: {
|
|
1948
|
+
doc: "Use gabled roof for the procedurally generated buildings."
|
|
1949
|
+
},
|
|
1950
|
+
parapet: {
|
|
1951
|
+
doc: "Use parapet roof for the procedurally generated buildings."
|
|
1952
|
+
},
|
|
1953
|
+
mansard: {
|
|
1954
|
+
doc: "Use mansard roof for the procedurally generated buildings."
|
|
1955
|
+
},
|
|
1956
|
+
skillion: {
|
|
1957
|
+
doc: "Use skillion roof for the procedurally generated buildings."
|
|
1958
|
+
},
|
|
1959
|
+
pyramidal: {
|
|
1960
|
+
doc: "Use pyramidal roof for the procedurally generated buildings."
|
|
1961
|
+
}
|
|
1962
|
+
},
|
|
1963
|
+
"default": "flat",
|
|
1964
|
+
doc: "Roof type to use for the procedural buildings.",
|
|
1965
|
+
experimental: true,
|
|
1966
|
+
"private": true,
|
|
1967
|
+
"sdk-support": {
|
|
1968
|
+
"basic functionality": {
|
|
1969
|
+
},
|
|
1970
|
+
"data-driven styling": {
|
|
1971
|
+
}
|
|
1972
|
+
},
|
|
1973
|
+
expression: {
|
|
1974
|
+
interpolated: false,
|
|
1975
|
+
parameters: [
|
|
1976
|
+
"feature"
|
|
1977
|
+
]
|
|
1978
|
+
},
|
|
1979
|
+
"property-type": "data-driven"
|
|
1980
|
+
},
|
|
1981
|
+
"building-height": {
|
|
1982
|
+
type: "number",
|
|
1983
|
+
"default": 0,
|
|
1984
|
+
minimum: 0,
|
|
1985
|
+
units: "meters",
|
|
1986
|
+
doc: "The height of the procedural buildings.",
|
|
1987
|
+
transition: true,
|
|
1988
|
+
experimental: true,
|
|
1989
|
+
"private": true,
|
|
1990
|
+
"sdk-support": {
|
|
1991
|
+
"basic functionality": {
|
|
1992
|
+
},
|
|
1993
|
+
"data-driven styling": {
|
|
1994
|
+
}
|
|
1995
|
+
},
|
|
1996
|
+
expression: {
|
|
1997
|
+
interpolated: false
|
|
1998
|
+
},
|
|
1999
|
+
"property-type": "data-driven"
|
|
2000
|
+
},
|
|
2001
|
+
"building-base": {
|
|
2002
|
+
type: "number",
|
|
2003
|
+
"default": 0,
|
|
2004
|
+
minimum: 0,
|
|
2005
|
+
units: "meters",
|
|
2006
|
+
doc: "The height with which to extrude the base of this layer. Must be less than or equal to `building-height`.",
|
|
2007
|
+
transition: true,
|
|
2008
|
+
requires: [
|
|
2009
|
+
"building-height"
|
|
2010
|
+
],
|
|
2011
|
+
experimental: true,
|
|
2012
|
+
"private": true,
|
|
2013
|
+
"sdk-support": {
|
|
2014
|
+
"basic functionality": {
|
|
2015
|
+
},
|
|
2016
|
+
"data-driven styling": {
|
|
2017
|
+
}
|
|
2018
|
+
},
|
|
2019
|
+
expression: {
|
|
2020
|
+
interpolated: false
|
|
2021
|
+
},
|
|
2022
|
+
"property-type": "data-driven"
|
|
2023
|
+
}
|
|
2024
|
+
};
|
|
1868
2025
|
var layout_line = {
|
|
1869
2026
|
"line-cap": {
|
|
1870
2027
|
type: "enum",
|
|
@@ -3806,6 +3963,20 @@
|
|
|
3806
3963
|
]
|
|
3807
3964
|
}
|
|
3808
3965
|
};
|
|
3966
|
+
var filter_building = {
|
|
3967
|
+
type: "boolean",
|
|
3968
|
+
doc: "Expression which determines whether or not to display a Polygon. Building layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
|
|
3969
|
+
"default": false,
|
|
3970
|
+
transition: false,
|
|
3971
|
+
"property-type": "data-driven",
|
|
3972
|
+
expression: {
|
|
3973
|
+
interpolated: false,
|
|
3974
|
+
parameters: [
|
|
3975
|
+
"zoom",
|
|
3976
|
+
"feature"
|
|
3977
|
+
]
|
|
3978
|
+
}
|
|
3979
|
+
};
|
|
3809
3980
|
var filter_heatmap = {
|
|
3810
3981
|
type: "boolean",
|
|
3811
3982
|
doc: "Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
|
|
@@ -6111,6 +6282,7 @@
|
|
|
6111
6282
|
"paint_circle",
|
|
6112
6283
|
"paint_heatmap",
|
|
6113
6284
|
"paint_fill-extrusion",
|
|
6285
|
+
"paint_building",
|
|
6114
6286
|
"paint_symbol",
|
|
6115
6287
|
"paint_raster",
|
|
6116
6288
|
"paint_raster-particle",
|
|
@@ -6318,6 +6490,30 @@
|
|
|
6318
6490
|
},
|
|
6319
6491
|
"property-type": "data-driven"
|
|
6320
6492
|
},
|
|
6493
|
+
"fill-pattern-cross-fade": {
|
|
6494
|
+
type: "number",
|
|
6495
|
+
"property-type": "data-constant",
|
|
6496
|
+
"default": 0,
|
|
6497
|
+
minimum: 0,
|
|
6498
|
+
maximum: 1,
|
|
6499
|
+
expression: {
|
|
6500
|
+
interpolated: true,
|
|
6501
|
+
parameters: [
|
|
6502
|
+
"zoom",
|
|
6503
|
+
"measure-light"
|
|
6504
|
+
]
|
|
6505
|
+
},
|
|
6506
|
+
requires: [
|
|
6507
|
+
"line-pattern"
|
|
6508
|
+
],
|
|
6509
|
+
"sdk-support": {
|
|
6510
|
+
"basic functionality": {
|
|
6511
|
+
js: "3.12.0"
|
|
6512
|
+
}
|
|
6513
|
+
},
|
|
6514
|
+
doc: "Controls the transition progress between the image variants of fill-pattern. Zero means the first variant is used, one is the second, and in between they are blended together.",
|
|
6515
|
+
transition: true
|
|
6516
|
+
},
|
|
6321
6517
|
"fill-emissive-strength": {
|
|
6322
6518
|
type: "number",
|
|
6323
6519
|
"default": 0,
|
|
@@ -6423,6 +6619,189 @@
|
|
|
6423
6619
|
"property-type": "data-driven"
|
|
6424
6620
|
}
|
|
6425
6621
|
};
|
|
6622
|
+
var paint_building = {
|
|
6623
|
+
"building-opacity": {
|
|
6624
|
+
type: "number",
|
|
6625
|
+
"default": 1,
|
|
6626
|
+
minimum: 0,
|
|
6627
|
+
maximum: 1,
|
|
6628
|
+
doc: "The opacity of the entire procedural buildings layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",
|
|
6629
|
+
transition: true,
|
|
6630
|
+
experimental: true,
|
|
6631
|
+
"private": true,
|
|
6632
|
+
"sdk-support": {
|
|
6633
|
+
"basic functionality": {
|
|
6634
|
+
}
|
|
6635
|
+
},
|
|
6636
|
+
expression: {
|
|
6637
|
+
interpolated: true,
|
|
6638
|
+
parameters: [
|
|
6639
|
+
"zoom"
|
|
6640
|
+
]
|
|
6641
|
+
},
|
|
6642
|
+
"property-type": "data-constant"
|
|
6643
|
+
},
|
|
6644
|
+
"building-ambient-occlusion-wall-intensity": {
|
|
6645
|
+
"property-type": "data-constant",
|
|
6646
|
+
type: "number",
|
|
6647
|
+
"default": 0,
|
|
6648
|
+
minimum: 0,
|
|
6649
|
+
maximum: 1,
|
|
6650
|
+
experimental: true,
|
|
6651
|
+
"private": true,
|
|
6652
|
+
expression: {
|
|
6653
|
+
interpolated: true,
|
|
6654
|
+
parameters: [
|
|
6655
|
+
"zoom"
|
|
6656
|
+
]
|
|
6657
|
+
},
|
|
6658
|
+
transition: true,
|
|
6659
|
+
doc: "Controls the intensity of shading concave angles between walls and building elements, such as facades and rooftop.",
|
|
6660
|
+
"sdk-support": {
|
|
6661
|
+
"basic functionality": {
|
|
6662
|
+
}
|
|
6663
|
+
}
|
|
6664
|
+
},
|
|
6665
|
+
"building-ambient-occlusion-ground-intensity": {
|
|
6666
|
+
"property-type": "data-constant",
|
|
6667
|
+
type: "number",
|
|
6668
|
+
"default": 0,
|
|
6669
|
+
minimum: 0,
|
|
6670
|
+
maximum: 1,
|
|
6671
|
+
experimental: true,
|
|
6672
|
+
"private": true,
|
|
6673
|
+
expression: {
|
|
6674
|
+
interpolated: true,
|
|
6675
|
+
parameters: [
|
|
6676
|
+
"zoom"
|
|
6677
|
+
]
|
|
6678
|
+
},
|
|
6679
|
+
transition: true,
|
|
6680
|
+
doc: "Controls the intensity of shading near ground",
|
|
6681
|
+
"sdk-support": {
|
|
6682
|
+
"basic functionality": {
|
|
6683
|
+
}
|
|
6684
|
+
}
|
|
6685
|
+
},
|
|
6686
|
+
"building-ambient-occlusion-ground-radius": {
|
|
6687
|
+
"property-type": "data-constant",
|
|
6688
|
+
type: "number",
|
|
6689
|
+
experimental: true,
|
|
6690
|
+
"private": true,
|
|
6691
|
+
"default": 3,
|
|
6692
|
+
minimum: 0,
|
|
6693
|
+
expression: {
|
|
6694
|
+
interpolated: true,
|
|
6695
|
+
parameters: [
|
|
6696
|
+
"zoom"
|
|
6697
|
+
]
|
|
6698
|
+
},
|
|
6699
|
+
transition: true,
|
|
6700
|
+
doc: "The extent of the ambient occlusion effect on the ground beneath the procedural buildings in meters.",
|
|
6701
|
+
"sdk-support": {
|
|
6702
|
+
"basic functionality": {
|
|
6703
|
+
}
|
|
6704
|
+
}
|
|
6705
|
+
},
|
|
6706
|
+
"building-ambient-occlusion-ground-attenuation": {
|
|
6707
|
+
"property-type": "data-constant",
|
|
6708
|
+
type: "number",
|
|
6709
|
+
experimental: true,
|
|
6710
|
+
"private": true,
|
|
6711
|
+
"default": 0.69,
|
|
6712
|
+
minimum: 0,
|
|
6713
|
+
maximum: 1,
|
|
6714
|
+
doc: "Provides a control to further fine-tune the look of the ambient occlusion on the ground beneath the procedural buildings. Lower values give the effect a more solid look while higher values make it smoother.",
|
|
6715
|
+
transition: true,
|
|
6716
|
+
expression: {
|
|
6717
|
+
interpolated: true,
|
|
6718
|
+
parameters: [
|
|
6719
|
+
"zoom"
|
|
6720
|
+
]
|
|
6721
|
+
},
|
|
6722
|
+
"sdk-support": {
|
|
6723
|
+
"basic functionality": {
|
|
6724
|
+
}
|
|
6725
|
+
}
|
|
6726
|
+
},
|
|
6727
|
+
"building-vertical-scale": {
|
|
6728
|
+
"property-type": "data-constant",
|
|
6729
|
+
type: "number",
|
|
6730
|
+
experimental: true,
|
|
6731
|
+
"private": true,
|
|
6732
|
+
"default": 1,
|
|
6733
|
+
minimum: 0,
|
|
6734
|
+
doc: "A global multiplier that can be used to scale base and height of the procedural buildings.",
|
|
6735
|
+
transition: true,
|
|
6736
|
+
expression: {
|
|
6737
|
+
interpolated: true,
|
|
6738
|
+
parameters: [
|
|
6739
|
+
"zoom"
|
|
6740
|
+
]
|
|
6741
|
+
},
|
|
6742
|
+
"sdk-support": {
|
|
6743
|
+
"basic functionality": {
|
|
6744
|
+
}
|
|
6745
|
+
}
|
|
6746
|
+
},
|
|
6747
|
+
"building-cast-shadows": {
|
|
6748
|
+
type: "boolean",
|
|
6749
|
+
"default": true,
|
|
6750
|
+
doc: "Enable/Disable shadow casting for this layer",
|
|
6751
|
+
transition: false,
|
|
6752
|
+
experimental: true,
|
|
6753
|
+
"private": true,
|
|
6754
|
+
"sdk-support": {
|
|
6755
|
+
"basic functionality": {
|
|
6756
|
+
}
|
|
6757
|
+
},
|
|
6758
|
+
"property-type": "data-constant"
|
|
6759
|
+
},
|
|
6760
|
+
"building-color": {
|
|
6761
|
+
type: "color",
|
|
6762
|
+
"default": "rgba(193, 154, 127, 1)",
|
|
6763
|
+
doc: "Color buildings. This can be styled using different building parts (e.g. windows, wall, roof, etc.). This won't be used if `building-roof-shape` has a value `flat`.",
|
|
6764
|
+
experimental: true,
|
|
6765
|
+
"private": true,
|
|
6766
|
+
"sdk-support": {
|
|
6767
|
+
"basic functionality": {
|
|
6768
|
+
},
|
|
6769
|
+
"data-driven styling": {
|
|
6770
|
+
}
|
|
6771
|
+
},
|
|
6772
|
+
expression: {
|
|
6773
|
+
interpolated: true,
|
|
6774
|
+
parameters: [
|
|
6775
|
+
"feature",
|
|
6776
|
+
"feature-state"
|
|
6777
|
+
]
|
|
6778
|
+
},
|
|
6779
|
+
"property-type": "data-driven"
|
|
6780
|
+
},
|
|
6781
|
+
"building-emissive-strength": {
|
|
6782
|
+
type: "number",
|
|
6783
|
+
"default": 0,
|
|
6784
|
+
minimum: 0,
|
|
6785
|
+
doc: "Controls the intensity of light emitted on the source features.",
|
|
6786
|
+
experimental: true,
|
|
6787
|
+
"private": true,
|
|
6788
|
+
"sdk-support": {
|
|
6789
|
+
"basic functionality": {
|
|
6790
|
+
},
|
|
6791
|
+
"data-driven styling": {
|
|
6792
|
+
}
|
|
6793
|
+
},
|
|
6794
|
+
expression: {
|
|
6795
|
+
interpolated: true,
|
|
6796
|
+
parameters: [
|
|
6797
|
+
"feature",
|
|
6798
|
+
"feature-state",
|
|
6799
|
+
"measure-light"
|
|
6800
|
+
]
|
|
6801
|
+
},
|
|
6802
|
+
"property-type": "data-driven"
|
|
6803
|
+
}
|
|
6804
|
+
};
|
|
6426
6805
|
var paint_line = {
|
|
6427
6806
|
"line-opacity": {
|
|
6428
6807
|
type: "number",
|
|
@@ -6719,6 +7098,30 @@
|
|
|
6719
7098
|
},
|
|
6720
7099
|
"property-type": "data-driven"
|
|
6721
7100
|
},
|
|
7101
|
+
"line-pattern-cross-fade": {
|
|
7102
|
+
type: "number",
|
|
7103
|
+
"property-type": "data-constant",
|
|
7104
|
+
"default": 0,
|
|
7105
|
+
minimum: 0,
|
|
7106
|
+
maximum: 1,
|
|
7107
|
+
expression: {
|
|
7108
|
+
interpolated: true,
|
|
7109
|
+
parameters: [
|
|
7110
|
+
"zoom",
|
|
7111
|
+
"measure-light"
|
|
7112
|
+
]
|
|
7113
|
+
},
|
|
7114
|
+
requires: [
|
|
7115
|
+
"line-pattern"
|
|
7116
|
+
],
|
|
7117
|
+
"sdk-support": {
|
|
7118
|
+
"basic functionality": {
|
|
7119
|
+
js: "3.12.0"
|
|
7120
|
+
}
|
|
7121
|
+
},
|
|
7122
|
+
doc: "Controls the transition progress between the image variants of line-pattern. Zero means the first variant is used, one is the second, and in between they are blended together.",
|
|
7123
|
+
transition: true
|
|
7124
|
+
},
|
|
6722
7125
|
"line-gradient": {
|
|
6723
7126
|
type: "color",
|
|
6724
7127
|
doc: "A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature's total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `\"lineMetrics\": true`.",
|
|
@@ -7797,7 +8200,7 @@
|
|
|
7797
8200
|
},
|
|
7798
8201
|
"icon-image-cross-fade": {
|
|
7799
8202
|
type: "number",
|
|
7800
|
-
"property-type": "data-
|
|
8203
|
+
"property-type": "data-constant",
|
|
7801
8204
|
"default": 0,
|
|
7802
8205
|
minimum: 0,
|
|
7803
8206
|
maximum: 1,
|
|
@@ -7805,8 +8208,6 @@
|
|
|
7805
8208
|
interpolated: true,
|
|
7806
8209
|
parameters: [
|
|
7807
8210
|
"zoom",
|
|
7808
|
-
"feature",
|
|
7809
|
-
"feature-state",
|
|
7810
8211
|
"measure-light"
|
|
7811
8212
|
]
|
|
7812
8213
|
},
|
|
@@ -7818,11 +8219,6 @@
|
|
|
7818
8219
|
js: "3.0.0",
|
|
7819
8220
|
android: "11.0.0",
|
|
7820
8221
|
ios: "11.0.0"
|
|
7821
|
-
},
|
|
7822
|
-
"data-driven styling": {
|
|
7823
|
-
js: "3.0.0",
|
|
7824
|
-
android: "11.0.0",
|
|
7825
|
-
ios: "11.0.0"
|
|
7826
8222
|
}
|
|
7827
8223
|
},
|
|
7828
8224
|
doc: "Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.",
|
|
@@ -9653,6 +10049,7 @@
|
|
|
9653
10049
|
"property-type": "constant"
|
|
9654
10050
|
}
|
|
9655
10051
|
},
|
|
10052
|
+
layout_building: layout_building,
|
|
9656
10053
|
layout_line: layout_line,
|
|
9657
10054
|
layout_symbol: layout_symbol,
|
|
9658
10055
|
layout_raster: layout_raster,
|
|
@@ -9725,6 +10122,7 @@
|
|
|
9725
10122
|
]
|
|
9726
10123
|
}
|
|
9727
10124
|
},
|
|
10125
|
+
filter_building: filter_building,
|
|
9728
10126
|
filter_heatmap: filter_heatmap,
|
|
9729
10127
|
filter_operator: filter_operator,
|
|
9730
10128
|
geometry_type: geometry_type,
|
|
@@ -9941,6 +10339,30 @@
|
|
|
9941
10339
|
},
|
|
9942
10340
|
"property-type": "data-driven"
|
|
9943
10341
|
},
|
|
10342
|
+
"fill-extrusion-pattern-cross-fade": {
|
|
10343
|
+
type: "number",
|
|
10344
|
+
"property-type": "data-constant",
|
|
10345
|
+
"default": 0,
|
|
10346
|
+
minimum: 0,
|
|
10347
|
+
maximum: 1,
|
|
10348
|
+
expression: {
|
|
10349
|
+
interpolated: true,
|
|
10350
|
+
parameters: [
|
|
10351
|
+
"zoom",
|
|
10352
|
+
"measure-light"
|
|
10353
|
+
]
|
|
10354
|
+
},
|
|
10355
|
+
requires: [
|
|
10356
|
+
"line-pattern"
|
|
10357
|
+
],
|
|
10358
|
+
"sdk-support": {
|
|
10359
|
+
"basic functionality": {
|
|
10360
|
+
js: "3.12.0"
|
|
10361
|
+
}
|
|
10362
|
+
},
|
|
10363
|
+
doc: "Controls the transition progress between the image variants of fill-extrusion-pattern. Zero means the first variant is used, one is the second, and in between they are blended together.",
|
|
10364
|
+
transition: true
|
|
10365
|
+
},
|
|
9944
10366
|
"fill-extrusion-height": {
|
|
9945
10367
|
type: "number",
|
|
9946
10368
|
"default": 0,
|
|
@@ -10479,6 +10901,7 @@
|
|
|
10479
10901
|
"property-type": "data-constant"
|
|
10480
10902
|
}
|
|
10481
10903
|
},
|
|
10904
|
+
paint_building: paint_building,
|
|
10482
10905
|
paint_line: paint_line,
|
|
10483
10906
|
paint_circle: paint_circle,
|
|
10484
10907
|
paint_heatmap: paint_heatmap,
|
|
@@ -12607,8 +13030,8 @@
|
|
|
12607
13030
|
])
|
|
12608
13031
|
});
|
|
12609
13032
|
}
|
|
12610
|
-
scaleSelf(factor) {
|
|
12611
|
-
this.options.transform.scaleSelf(factor);
|
|
13033
|
+
scaleSelf(factor, yFactor) {
|
|
13034
|
+
this.options.transform.scaleSelf(factor, yFactor);
|
|
12612
13035
|
return this;
|
|
12613
13036
|
}
|
|
12614
13037
|
}
|
|
@@ -12903,6 +13326,7 @@
|
|
|
12903
13326
|
}
|
|
12904
13327
|
return new Assertion(type, parsed);
|
|
12905
13328
|
}
|
|
13329
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12906
13330
|
evaluate(ctx) {
|
|
12907
13331
|
for (let i = 0; i < this.args.length; i++) {
|
|
12908
13332
|
const value = this.args[i].evaluate(ctx);
|
|
@@ -13322,6 +13746,7 @@
|
|
|
13322
13746
|
}
|
|
13323
13747
|
return new Coercion(type, parsed);
|
|
13324
13748
|
}
|
|
13749
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13325
13750
|
evaluate(ctx) {
|
|
13326
13751
|
if (this.type.kind === 'boolean') {
|
|
13327
13752
|
return Boolean(this.args[0].evaluate(ctx));
|
|
@@ -13623,6 +14048,306 @@
|
|
|
13623
14048
|
}
|
|
13624
14049
|
}
|
|
13625
14050
|
|
|
14051
|
+
var pointGeometry;
|
|
14052
|
+
var hasRequiredPointGeometry;
|
|
14053
|
+
|
|
14054
|
+
function requirePointGeometry () {
|
|
14055
|
+
if (hasRequiredPointGeometry) return pointGeometry;
|
|
14056
|
+
hasRequiredPointGeometry = 1;
|
|
14057
|
+
pointGeometry = Point;
|
|
14058
|
+
/**
|
|
14059
|
+
* A standalone point geometry with useful accessor, comparison, and
|
|
14060
|
+
* modification methods.
|
|
14061
|
+
*
|
|
14062
|
+
* @class Point
|
|
14063
|
+
* @param {Number} x the x-coordinate. this could be longitude or screen
|
|
14064
|
+
* pixels, or any other sort of unit.
|
|
14065
|
+
* @param {Number} y the y-coordinate. this could be latitude or screen
|
|
14066
|
+
* pixels, or any other sort of unit.
|
|
14067
|
+
* @example
|
|
14068
|
+
* var point = new Point(-77, 38);
|
|
14069
|
+
*/
|
|
14070
|
+
function Point(x, y) {
|
|
14071
|
+
this.x = x;
|
|
14072
|
+
this.y = y;
|
|
14073
|
+
}
|
|
14074
|
+
Point.prototype = {
|
|
14075
|
+
/**
|
|
14076
|
+
* Clone this point, returning a new point that can be modified
|
|
14077
|
+
* without affecting the old one.
|
|
14078
|
+
* @return {Point} the clone
|
|
14079
|
+
*/
|
|
14080
|
+
clone: function () {
|
|
14081
|
+
return new Point(this.x, this.y);
|
|
14082
|
+
},
|
|
14083
|
+
/**
|
|
14084
|
+
* Add this point's x & y coordinates to another point,
|
|
14085
|
+
* yielding a new point.
|
|
14086
|
+
* @param {Point} p the other point
|
|
14087
|
+
* @return {Point} output point
|
|
14088
|
+
*/
|
|
14089
|
+
add: function (p) {
|
|
14090
|
+
return this.clone()._add(p);
|
|
14091
|
+
},
|
|
14092
|
+
/**
|
|
14093
|
+
* Subtract this point's x & y coordinates to from point,
|
|
14094
|
+
* yielding a new point.
|
|
14095
|
+
* @param {Point} p the other point
|
|
14096
|
+
* @return {Point} output point
|
|
14097
|
+
*/
|
|
14098
|
+
sub: function (p) {
|
|
14099
|
+
return this.clone()._sub(p);
|
|
14100
|
+
},
|
|
14101
|
+
/**
|
|
14102
|
+
* Multiply this point's x & y coordinates by point,
|
|
14103
|
+
* yielding a new point.
|
|
14104
|
+
* @param {Point} p the other point
|
|
14105
|
+
* @return {Point} output point
|
|
14106
|
+
*/
|
|
14107
|
+
multByPoint: function (p) {
|
|
14108
|
+
return this.clone()._multByPoint(p);
|
|
14109
|
+
},
|
|
14110
|
+
/**
|
|
14111
|
+
* Divide this point's x & y coordinates by point,
|
|
14112
|
+
* yielding a new point.
|
|
14113
|
+
* @param {Point} p the other point
|
|
14114
|
+
* @return {Point} output point
|
|
14115
|
+
*/
|
|
14116
|
+
divByPoint: function (p) {
|
|
14117
|
+
return this.clone()._divByPoint(p);
|
|
14118
|
+
},
|
|
14119
|
+
/**
|
|
14120
|
+
* Multiply this point's x & y coordinates by a factor,
|
|
14121
|
+
* yielding a new point.
|
|
14122
|
+
* @param {Point} k factor
|
|
14123
|
+
* @return {Point} output point
|
|
14124
|
+
*/
|
|
14125
|
+
mult: function (k) {
|
|
14126
|
+
return this.clone()._mult(k);
|
|
14127
|
+
},
|
|
14128
|
+
/**
|
|
14129
|
+
* Divide this point's x & y coordinates by a factor,
|
|
14130
|
+
* yielding a new point.
|
|
14131
|
+
* @param {Point} k factor
|
|
14132
|
+
* @return {Point} output point
|
|
14133
|
+
*/
|
|
14134
|
+
div: function (k) {
|
|
14135
|
+
return this.clone()._div(k);
|
|
14136
|
+
},
|
|
14137
|
+
/**
|
|
14138
|
+
* Rotate this point around the 0, 0 origin by an angle a,
|
|
14139
|
+
* given in radians
|
|
14140
|
+
* @param {Number} a angle to rotate around, in radians
|
|
14141
|
+
* @return {Point} output point
|
|
14142
|
+
*/
|
|
14143
|
+
rotate: function (a) {
|
|
14144
|
+
return this.clone()._rotate(a);
|
|
14145
|
+
},
|
|
14146
|
+
/**
|
|
14147
|
+
* Rotate this point around p point by an angle a,
|
|
14148
|
+
* given in radians
|
|
14149
|
+
* @param {Number} a angle to rotate around, in radians
|
|
14150
|
+
* @param {Point} p Point to rotate around
|
|
14151
|
+
* @return {Point} output point
|
|
14152
|
+
*/
|
|
14153
|
+
rotateAround: function (a, p) {
|
|
14154
|
+
return this.clone()._rotateAround(a, p);
|
|
14155
|
+
},
|
|
14156
|
+
/**
|
|
14157
|
+
* Multiply this point by a 4x1 transformation matrix
|
|
14158
|
+
* @param {Array<Number>} m transformation matrix
|
|
14159
|
+
* @return {Point} output point
|
|
14160
|
+
*/
|
|
14161
|
+
matMult: function (m) {
|
|
14162
|
+
return this.clone()._matMult(m);
|
|
14163
|
+
},
|
|
14164
|
+
/**
|
|
14165
|
+
* Calculate this point but as a unit vector from 0, 0, meaning
|
|
14166
|
+
* that the distance from the resulting point to the 0, 0
|
|
14167
|
+
* coordinate will be equal to 1 and the angle from the resulting
|
|
14168
|
+
* point to the 0, 0 coordinate will be the same as before.
|
|
14169
|
+
* @return {Point} unit vector point
|
|
14170
|
+
*/
|
|
14171
|
+
unit: function () {
|
|
14172
|
+
return this.clone()._unit();
|
|
14173
|
+
},
|
|
14174
|
+
/**
|
|
14175
|
+
* Compute a perpendicular point, where the new y coordinate
|
|
14176
|
+
* is the old x coordinate and the new x coordinate is the old y
|
|
14177
|
+
* coordinate multiplied by -1
|
|
14178
|
+
* @return {Point} perpendicular point
|
|
14179
|
+
*/
|
|
14180
|
+
perp: function () {
|
|
14181
|
+
return this.clone()._perp();
|
|
14182
|
+
},
|
|
14183
|
+
/**
|
|
14184
|
+
* Return a version of this point with the x & y coordinates
|
|
14185
|
+
* rounded to integers.
|
|
14186
|
+
* @return {Point} rounded point
|
|
14187
|
+
*/
|
|
14188
|
+
round: function () {
|
|
14189
|
+
return this.clone()._round();
|
|
14190
|
+
},
|
|
14191
|
+
/**
|
|
14192
|
+
* Return the magitude of this point: this is the Euclidean
|
|
14193
|
+
* distance from the 0, 0 coordinate to this point's x and y
|
|
14194
|
+
* coordinates.
|
|
14195
|
+
* @return {Number} magnitude
|
|
14196
|
+
*/
|
|
14197
|
+
mag: function () {
|
|
14198
|
+
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
14199
|
+
},
|
|
14200
|
+
/**
|
|
14201
|
+
* Judge whether this point is equal to another point, returning
|
|
14202
|
+
* true or false.
|
|
14203
|
+
* @param {Point} other the other point
|
|
14204
|
+
* @return {boolean} whether the points are equal
|
|
14205
|
+
*/
|
|
14206
|
+
equals: function (other) {
|
|
14207
|
+
return this.x === other.x && this.y === other.y;
|
|
14208
|
+
},
|
|
14209
|
+
/**
|
|
14210
|
+
* Calculate the distance from this point to another point
|
|
14211
|
+
* @param {Point} p the other point
|
|
14212
|
+
* @return {Number} distance
|
|
14213
|
+
*/
|
|
14214
|
+
dist: function (p) {
|
|
14215
|
+
return Math.sqrt(this.distSqr(p));
|
|
14216
|
+
},
|
|
14217
|
+
/**
|
|
14218
|
+
* Calculate the distance from this point to another point,
|
|
14219
|
+
* without the square root step. Useful if you're comparing
|
|
14220
|
+
* relative distances.
|
|
14221
|
+
* @param {Point} p the other point
|
|
14222
|
+
* @return {Number} distance
|
|
14223
|
+
*/
|
|
14224
|
+
distSqr: function (p) {
|
|
14225
|
+
var dx = p.x - this.x, dy = p.y - this.y;
|
|
14226
|
+
return dx * dx + dy * dy;
|
|
14227
|
+
},
|
|
14228
|
+
/**
|
|
14229
|
+
* Get the angle from the 0, 0 coordinate to this point, in radians
|
|
14230
|
+
* coordinates.
|
|
14231
|
+
* @return {Number} angle
|
|
14232
|
+
*/
|
|
14233
|
+
angle: function () {
|
|
14234
|
+
return Math.atan2(this.y, this.x);
|
|
14235
|
+
},
|
|
14236
|
+
/**
|
|
14237
|
+
* Get the angle from this point to another point, in radians
|
|
14238
|
+
* @param {Point} b the other point
|
|
14239
|
+
* @return {Number} angle
|
|
14240
|
+
*/
|
|
14241
|
+
angleTo: function (b) {
|
|
14242
|
+
return Math.atan2(this.y - b.y, this.x - b.x);
|
|
14243
|
+
},
|
|
14244
|
+
/**
|
|
14245
|
+
* Get the angle between this point and another point, in radians
|
|
14246
|
+
* @param {Point} b the other point
|
|
14247
|
+
* @return {Number} angle
|
|
14248
|
+
*/
|
|
14249
|
+
angleWith: function (b) {
|
|
14250
|
+
return this.angleWithSep(b.x, b.y);
|
|
14251
|
+
},
|
|
14252
|
+
/*
|
|
14253
|
+
* Find the angle of the two vectors, solving the formula for
|
|
14254
|
+
* the cross product a x b = |a||b|sin(θ) for θ.
|
|
14255
|
+
* @param {Number} x the x-coordinate
|
|
14256
|
+
* @param {Number} y the y-coordinate
|
|
14257
|
+
* @return {Number} the angle in radians
|
|
14258
|
+
*/
|
|
14259
|
+
angleWithSep: function (x, y) {
|
|
14260
|
+
return Math.atan2(this.x * y - this.y * x, this.x * x + this.y * y);
|
|
14261
|
+
},
|
|
14262
|
+
_matMult: function (m) {
|
|
14263
|
+
var x = m[0] * this.x + m[1] * this.y, y = m[2] * this.x + m[3] * this.y;
|
|
14264
|
+
this.x = x;
|
|
14265
|
+
this.y = y;
|
|
14266
|
+
return this;
|
|
14267
|
+
},
|
|
14268
|
+
_add: function (p) {
|
|
14269
|
+
this.x += p.x;
|
|
14270
|
+
this.y += p.y;
|
|
14271
|
+
return this;
|
|
14272
|
+
},
|
|
14273
|
+
_sub: function (p) {
|
|
14274
|
+
this.x -= p.x;
|
|
14275
|
+
this.y -= p.y;
|
|
14276
|
+
return this;
|
|
14277
|
+
},
|
|
14278
|
+
_mult: function (k) {
|
|
14279
|
+
this.x *= k;
|
|
14280
|
+
this.y *= k;
|
|
14281
|
+
return this;
|
|
14282
|
+
},
|
|
14283
|
+
_div: function (k) {
|
|
14284
|
+
this.x /= k;
|
|
14285
|
+
this.y /= k;
|
|
14286
|
+
return this;
|
|
14287
|
+
},
|
|
14288
|
+
_multByPoint: function (p) {
|
|
14289
|
+
this.x *= p.x;
|
|
14290
|
+
this.y *= p.y;
|
|
14291
|
+
return this;
|
|
14292
|
+
},
|
|
14293
|
+
_divByPoint: function (p) {
|
|
14294
|
+
this.x /= p.x;
|
|
14295
|
+
this.y /= p.y;
|
|
14296
|
+
return this;
|
|
14297
|
+
},
|
|
14298
|
+
_unit: function () {
|
|
14299
|
+
this._div(this.mag());
|
|
14300
|
+
return this;
|
|
14301
|
+
},
|
|
14302
|
+
_perp: function () {
|
|
14303
|
+
var y = this.y;
|
|
14304
|
+
this.y = this.x;
|
|
14305
|
+
this.x = -y;
|
|
14306
|
+
return this;
|
|
14307
|
+
},
|
|
14308
|
+
_rotate: function (angle) {
|
|
14309
|
+
var cos = Math.cos(angle), sin = Math.sin(angle), x = cos * this.x - sin * this.y, y = sin * this.x + cos * this.y;
|
|
14310
|
+
this.x = x;
|
|
14311
|
+
this.y = y;
|
|
14312
|
+
return this;
|
|
14313
|
+
},
|
|
14314
|
+
_rotateAround: function (angle, p) {
|
|
14315
|
+
var cos = Math.cos(angle), sin = Math.sin(angle), x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y), y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);
|
|
14316
|
+
this.x = x;
|
|
14317
|
+
this.y = y;
|
|
14318
|
+
return this;
|
|
14319
|
+
},
|
|
14320
|
+
_round: function () {
|
|
14321
|
+
this.x = Math.round(this.x);
|
|
14322
|
+
this.y = Math.round(this.y);
|
|
14323
|
+
return this;
|
|
14324
|
+
}
|
|
14325
|
+
};
|
|
14326
|
+
/**
|
|
14327
|
+
* Construct a point from an array if necessary, otherwise if the input
|
|
14328
|
+
* is already a Point, or an unknown type, return it unchanged
|
|
14329
|
+
* @param {Array<Number>|Point|*} a any kind of input value
|
|
14330
|
+
* @return {Point} constructed point, or passed-through value.
|
|
14331
|
+
* @example
|
|
14332
|
+
* // this
|
|
14333
|
+
* var point = Point.convert([0, 1]);
|
|
14334
|
+
* // is equivalent to
|
|
14335
|
+
* var point = new Point(0, 1);
|
|
14336
|
+
*/
|
|
14337
|
+
Point.convert = function (a) {
|
|
14338
|
+
if (a instanceof Point) {
|
|
14339
|
+
return a;
|
|
14340
|
+
}
|
|
14341
|
+
if (Array.isArray(a)) {
|
|
14342
|
+
return new Point(a[0], a[1]);
|
|
14343
|
+
}
|
|
14344
|
+
return a;
|
|
14345
|
+
};
|
|
14346
|
+
return pointGeometry;
|
|
14347
|
+
}
|
|
14348
|
+
|
|
14349
|
+
requirePointGeometry();
|
|
14350
|
+
|
|
13626
14351
|
function calculateSignedArea(ring) {
|
|
13627
14352
|
let sum = 0;
|
|
13628
14353
|
for (let i = 0, len = ring.length, j = len - 1, p1, p2; i < len; j = i++) {
|
|
@@ -15158,6 +15883,7 @@
|
|
|
15158
15883
|
}
|
|
15159
15884
|
return new Config(type, toString(configKey.value));
|
|
15160
15885
|
}
|
|
15886
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15161
15887
|
evaluate(ctx) {
|
|
15162
15888
|
const FQIDSeparator = '\x1F';
|
|
15163
15889
|
const configKey = [
|
|
@@ -15302,6 +16028,7 @@
|
|
|
15302
16028
|
}
|
|
15303
16029
|
return new Var(name, context.scope.get(name));
|
|
15304
16030
|
}
|
|
16031
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15305
16032
|
evaluate(ctx) {
|
|
15306
16033
|
return this.boundExpression.evaluate(ctx);
|
|
15307
16034
|
}
|
|
@@ -15567,6 +16294,7 @@
|
|
|
15567
16294
|
}
|
|
15568
16295
|
return new Step(outputType, input, stops);
|
|
15569
16296
|
}
|
|
16297
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15570
16298
|
evaluate(ctx) {
|
|
15571
16299
|
const labels = this.labels;
|
|
15572
16300
|
const outputs = this.outputs;
|
|
@@ -15969,6 +16697,7 @@
|
|
|
15969
16697
|
const needsAnnotation = expectedType && parsedArgs.some(arg => checkSubtype(expectedType, arg.type));
|
|
15970
16698
|
return needsAnnotation ? new Coalesce(ValueType, parsedArgs) : new Coalesce(outputType, parsedArgs);
|
|
15971
16699
|
}
|
|
16700
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15972
16701
|
evaluate(ctx) {
|
|
15973
16702
|
let result = null;
|
|
15974
16703
|
let argCount = 0;
|
|
@@ -16011,6 +16740,7 @@
|
|
|
16011
16740
|
this.bindings = [].concat(bindings);
|
|
16012
16741
|
this.result = result;
|
|
16013
16742
|
}
|
|
16743
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16014
16744
|
evaluate(ctx) {
|
|
16015
16745
|
return this.result.evaluate(ctx);
|
|
16016
16746
|
}
|
|
@@ -16253,6 +16983,7 @@
|
|
|
16253
16983
|
return new IndexOf(needle, haystack);
|
|
16254
16984
|
}
|
|
16255
16985
|
}
|
|
16986
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16256
16987
|
evaluate(ctx) {
|
|
16257
16988
|
const needle = this.needle.evaluate(ctx);
|
|
16258
16989
|
const haystack = this.haystack.evaluate(ctx);
|
|
@@ -16369,6 +17100,7 @@
|
|
|
16369
17100
|
}
|
|
16370
17101
|
return new Match(inputType, outputType, input, cases, outputs, otherwise);
|
|
16371
17102
|
}
|
|
17103
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16372
17104
|
evaluate(ctx) {
|
|
16373
17105
|
const input = this.input.evaluate(ctx);
|
|
16374
17106
|
const output = typeOf(input) === this.inputType && this.outputs[this.cases[input]] || this.otherwise;
|
|
@@ -16450,6 +17182,7 @@
|
|
|
16450
17182
|
return null;
|
|
16451
17183
|
return new Case(outputType, branches, otherwise);
|
|
16452
17184
|
}
|
|
17185
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16453
17186
|
evaluate(ctx) {
|
|
16454
17187
|
for (const [test, expression] of this.branches) {
|
|
16455
17188
|
if (test.evaluate(ctx)) {
|
|
@@ -16508,6 +17241,7 @@
|
|
|
16508
17241
|
return new Slice(input.type, input, beginIndex);
|
|
16509
17242
|
}
|
|
16510
17243
|
}
|
|
17244
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16511
17245
|
evaluate(ctx) {
|
|
16512
17246
|
const input = this.input.evaluate(ctx);
|
|
16513
17247
|
const beginIndex = this.beginIndex.evaluate(ctx);
|
|
@@ -17028,6 +17762,7 @@
|
|
|
17028
17762
|
overloads: [
|
|
17029
17763
|
[
|
|
17030
17764
|
[StringType],
|
|
17765
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17031
17766
|
(ctx, [key]) => get(key.evaluate(ctx), ctx.properties())
|
|
17032
17767
|
],
|
|
17033
17768
|
[
|
|
@@ -17035,6 +17770,7 @@
|
|
|
17035
17770
|
StringType,
|
|
17036
17771
|
ObjectType
|
|
17037
17772
|
],
|
|
17773
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17038
17774
|
(ctx, [key, obj]) => get(key.evaluate(ctx), obj.evaluate(ctx))
|
|
17039
17775
|
]
|
|
17040
17776
|
]
|
|
@@ -17042,6 +17778,7 @@
|
|
|
17042
17778
|
'feature-state': [
|
|
17043
17779
|
ValueType,
|
|
17044
17780
|
[StringType],
|
|
17781
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17045
17782
|
(ctx, [key]) => get(key.evaluate(ctx), ctx.featureState || {})
|
|
17046
17783
|
],
|
|
17047
17784
|
'properties': [
|
|
@@ -17239,11 +17976,13 @@
|
|
|
17239
17976
|
'min': [
|
|
17240
17977
|
NumberType,
|
|
17241
17978
|
varargs(NumberType),
|
|
17979
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17242
17980
|
(ctx, args) => Math.min(...args.map(arg => arg.evaluate(ctx)))
|
|
17243
17981
|
],
|
|
17244
17982
|
'max': [
|
|
17245
17983
|
NumberType,
|
|
17246
17984
|
varargs(NumberType),
|
|
17985
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17247
17986
|
(ctx, args) => Math.max(...args.map(arg => arg.evaluate(ctx)))
|
|
17248
17987
|
],
|
|
17249
17988
|
'abs': [
|
|
@@ -17417,6 +18156,7 @@
|
|
|
17417
18156
|
BooleanType,
|
|
17418
18157
|
BooleanType
|
|
17419
18158
|
],
|
|
18159
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17420
18160
|
(ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx)
|
|
17421
18161
|
],
|
|
17422
18162
|
[
|
|
@@ -17439,6 +18179,7 @@
|
|
|
17439
18179
|
BooleanType,
|
|
17440
18180
|
BooleanType
|
|
17441
18181
|
],
|
|
18182
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17442
18183
|
(ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx)
|
|
17443
18184
|
],
|
|
17444
18185
|
[
|
|
@@ -17473,11 +18214,13 @@
|
|
|
17473
18214
|
'upcase': [
|
|
17474
18215
|
StringType,
|
|
17475
18216
|
[StringType],
|
|
18217
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17476
18218
|
(ctx, [s]) => s.evaluate(ctx).toUpperCase()
|
|
17477
18219
|
],
|
|
17478
18220
|
'downcase': [
|
|
17479
18221
|
StringType,
|
|
17480
18222
|
[StringType],
|
|
18223
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17481
18224
|
(ctx, [s]) => s.evaluate(ctx).toLowerCase()
|
|
17482
18225
|
],
|
|
17483
18226
|
'concat': [
|
|
@@ -17488,6 +18231,7 @@
|
|
|
17488
18231
|
'resolved-locale': [
|
|
17489
18232
|
StringType,
|
|
17490
18233
|
[CollatorType],
|
|
18234
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17491
18235
|
(ctx, [collator]) => collator.evaluate(ctx).resolvedLocale()
|
|
17492
18236
|
],
|
|
17493
18237
|
'random': [
|
|
@@ -17635,6 +18379,7 @@
|
|
|
17635
18379
|
kind: 'composite',
|
|
17636
18380
|
interpolationType,
|
|
17637
18381
|
interpolationFactor: Interpolate.interpolationFactor.bind(void 0, interpolationType),
|
|
18382
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17638
18383
|
zoomStops: featureFunctionStops.map(s => s[0]),
|
|
17639
18384
|
evaluate({zoom}, properties) {
|
|
17640
18385
|
return evaluateExponentialFunction({
|
|
@@ -17652,7 +18397,9 @@
|
|
|
17652
18397
|
kind: 'camera',
|
|
17653
18398
|
interpolationType,
|
|
17654
18399
|
interpolationFactor: Interpolate.interpolationFactor.bind(void 0, interpolationType),
|
|
18400
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17655
18401
|
zoomStops: parameters.stops.map(s => s[0]),
|
|
18402
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17656
18403
|
evaluate: ({zoom}) => innerFun(parameters, propertySpec, zoom, hashedStops, categoricalKeyType)
|
|
17657
18404
|
};
|
|
17658
18405
|
} else {
|
|
@@ -18758,7 +19505,8 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
18758
19505
|
negate
|
|
18759
19506
|
];
|
|
18760
19507
|
}
|
|
18761
|
-
return [negate ? 'all' : 'any'].concat(
|
|
19508
|
+
return [negate ? 'all' : 'any'].concat(// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19509
|
+
values.map(v => [
|
|
18762
19510
|
negate ? '!=' : '==',
|
|
18763
19511
|
get,
|
|
18764
19512
|
v
|
|
@@ -19043,7 +19791,15 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
19043
19791
|
/**
|
|
19044
19792
|
* { command: 'updateImport', args: [importId, importSpecification | styleUrl] }
|
|
19045
19793
|
*/
|
|
19046
|
-
updateImport: 'updateImport'
|
|
19794
|
+
updateImport: 'updateImport',
|
|
19795
|
+
/*
|
|
19796
|
+
* { command: 'addIconset', args: [iconsetId, IconsetSpecification] }
|
|
19797
|
+
*/
|
|
19798
|
+
addIconset: 'addIconset',
|
|
19799
|
+
/*
|
|
19800
|
+
* { command: 'removeIconset', args: [iconsetId] }
|
|
19801
|
+
*/
|
|
19802
|
+
removeIconset: 'removeIconset'
|
|
19047
19803
|
};
|
|
19048
19804
|
function addSource(sourceId, after, commands) {
|
|
19049
19805
|
commands.push({
|
|
@@ -19350,6 +20106,47 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
19350
20106
|
});
|
|
19351
20107
|
}
|
|
19352
20108
|
}
|
|
20109
|
+
function diffIconsets(before, after, commands) {
|
|
20110
|
+
before = before || {};
|
|
20111
|
+
after = after || {};
|
|
20112
|
+
let iconsetId;
|
|
20113
|
+
for (iconsetId in before) {
|
|
20114
|
+
if (!before.hasOwnProperty(iconsetId))
|
|
20115
|
+
continue;
|
|
20116
|
+
if (!after.hasOwnProperty(iconsetId)) {
|
|
20117
|
+
commands.push({
|
|
20118
|
+
command: operations.removeIconset,
|
|
20119
|
+
args: [iconsetId]
|
|
20120
|
+
});
|
|
20121
|
+
}
|
|
20122
|
+
}
|
|
20123
|
+
for (iconsetId in after) {
|
|
20124
|
+
if (!after.hasOwnProperty(iconsetId))
|
|
20125
|
+
continue;
|
|
20126
|
+
const iconset = after[iconsetId];
|
|
20127
|
+
if (!before.hasOwnProperty(iconsetId)) {
|
|
20128
|
+
commands.push({
|
|
20129
|
+
command: operations.addIconset,
|
|
20130
|
+
args: [
|
|
20131
|
+
iconsetId,
|
|
20132
|
+
iconset
|
|
20133
|
+
]
|
|
20134
|
+
});
|
|
20135
|
+
} else if (!deepEqual(before[iconsetId], iconset)) {
|
|
20136
|
+
commands.push({
|
|
20137
|
+
command: operations.removeIconset,
|
|
20138
|
+
args: [iconsetId]
|
|
20139
|
+
});
|
|
20140
|
+
commands.push({
|
|
20141
|
+
command: operations.addIconset,
|
|
20142
|
+
args: [
|
|
20143
|
+
iconsetId,
|
|
20144
|
+
iconset
|
|
20145
|
+
]
|
|
20146
|
+
});
|
|
20147
|
+
}
|
|
20148
|
+
}
|
|
20149
|
+
}
|
|
19353
20150
|
function diffStyles(before, after) {
|
|
19354
20151
|
if (!before)
|
|
19355
20152
|
return [{
|
|
@@ -19451,6 +20248,9 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
19451
20248
|
args: [after.camera]
|
|
19452
20249
|
});
|
|
19453
20250
|
}
|
|
20251
|
+
if (!deepEqual(before.iconsets, after.iconsets)) {
|
|
20252
|
+
diffIconsets(before.iconsets, after.iconsets, commands);
|
|
20253
|
+
}
|
|
19454
20254
|
if (!deepEqual(before['color-theme'], after['color-theme'])) {
|
|
19455
20255
|
return [{
|
|
19456
20256
|
command: operations.setStyle,
|
|
@@ -20204,8 +21004,8 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
20204
21004
|
'raster-particle'
|
|
20205
21005
|
].includes(type)) {
|
|
20206
21006
|
errors.push(new ValidationError(key, layer.source, `raster-array source can only be used with layer type 'raster'.`));
|
|
20207
|
-
} else if (type === 'line' && layer.paint && (layer.paint['line-gradient'] || layer.paint['line-trim-offset']) && (sourceType
|
|
20208
|
-
errors.push(new ValidationError(key, layer, `layer "${ layer.id }" specifies a line-gradient, which requires
|
|
21007
|
+
} else if (type === 'line' && layer.paint && (layer.paint['line-gradient'] || layer.paint['line-trim-offset']) && (sourceType === 'geojson' && !source.lineMetrics)) {
|
|
21008
|
+
errors.push(new ValidationError(key, layer, `layer "${ layer.id }" specifies a line-gradient, which requires the GeoJSON source to have \`lineMetrics\` enabled.`));
|
|
20209
21009
|
} else if (type === 'raster-particle' && sourceType !== 'raster-array') {
|
|
20210
21010
|
errors.push(new ValidationError(key, layer.source, `layer "${ layer.id }" requires a 'raster-array' source.`));
|
|
20211
21011
|
}
|
|
@@ -21962,7 +22762,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
21962
22762
|
return !!value.match(regex);
|
|
21963
22763
|
}
|
|
21964
22764
|
function getSourceCount(source) {
|
|
21965
|
-
if (source
|
|
22765
|
+
if ('url' in source) {
|
|
21966
22766
|
return source.url.split(',').length;
|
|
21967
22767
|
} else {
|
|
21968
22768
|
return 0;
|
|
@@ -22001,7 +22801,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
22001
22801
|
errors.push(new ValidationError(`sources[${ i }].type`, source.type, `Expected one of [${ Array.from(acceptedSourceTypes).join(', ') }]`));
|
|
22002
22802
|
}
|
|
22003
22803
|
const sourceUrlPattern = /^mapbox:\/\/([^/]*)$/;
|
|
22004
|
-
if (!
|
|
22804
|
+
if (!('url' in source) || !isValid(source.url, sourceUrlPattern)) {
|
|
22005
22805
|
errors.push(new ValidationError(`sources[${ i }].url`, source.url, 'Expected a valid Mapbox tileset url'));
|
|
22006
22806
|
}
|
|
22007
22807
|
return errors;
|