@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.es.js
CHANGED
|
@@ -788,6 +788,16 @@ var source_vector = {
|
|
|
788
788
|
],
|
|
789
789
|
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."
|
|
790
790
|
},
|
|
791
|
+
extra_bounds: {
|
|
792
|
+
type: "array",
|
|
793
|
+
value: {
|
|
794
|
+
type: "array",
|
|
795
|
+
value: "number",
|
|
796
|
+
length: 4,
|
|
797
|
+
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]`."
|
|
798
|
+
},
|
|
799
|
+
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."
|
|
800
|
+
},
|
|
791
801
|
scheme: {
|
|
792
802
|
type: "enum",
|
|
793
803
|
values: {
|
|
@@ -867,6 +877,16 @@ var source_raster = {
|
|
|
867
877
|
],
|
|
868
878
|
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."
|
|
869
879
|
},
|
|
880
|
+
extra_bounds: {
|
|
881
|
+
type: "array",
|
|
882
|
+
value: {
|
|
883
|
+
type: "array",
|
|
884
|
+
value: "number",
|
|
885
|
+
length: 4,
|
|
886
|
+
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]`."
|
|
887
|
+
},
|
|
888
|
+
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."
|
|
889
|
+
},
|
|
870
890
|
minzoom: {
|
|
871
891
|
type: "number",
|
|
872
892
|
"default": 0,
|
|
@@ -948,6 +968,16 @@ var source_raster_dem = {
|
|
|
948
968
|
],
|
|
949
969
|
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."
|
|
950
970
|
},
|
|
971
|
+
extra_bounds: {
|
|
972
|
+
type: "array",
|
|
973
|
+
value: {
|
|
974
|
+
type: "array",
|
|
975
|
+
value: "number",
|
|
976
|
+
length: 4,
|
|
977
|
+
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]`."
|
|
978
|
+
},
|
|
979
|
+
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."
|
|
980
|
+
},
|
|
951
981
|
minzoom: {
|
|
952
982
|
type: "number",
|
|
953
983
|
"default": 0,
|
|
@@ -1030,6 +1060,16 @@ var source_raster_array = {
|
|
|
1030
1060
|
],
|
|
1031
1061
|
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."
|
|
1032
1062
|
},
|
|
1063
|
+
extra_bounds: {
|
|
1064
|
+
type: "array",
|
|
1065
|
+
value: {
|
|
1066
|
+
type: "array",
|
|
1067
|
+
value: "number",
|
|
1068
|
+
length: 4,
|
|
1069
|
+
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]`."
|
|
1070
|
+
},
|
|
1071
|
+
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."
|
|
1072
|
+
},
|
|
1033
1073
|
minzoom: {
|
|
1034
1074
|
type: "number",
|
|
1035
1075
|
"default": 0,
|
|
@@ -1321,6 +1361,13 @@ var layer = {
|
|
|
1321
1361
|
}
|
|
1322
1362
|
}
|
|
1323
1363
|
},
|
|
1364
|
+
building: {
|
|
1365
|
+
doc: "A procedural 3D building.",
|
|
1366
|
+
"sdk-support": {
|
|
1367
|
+
},
|
|
1368
|
+
experimental: true,
|
|
1369
|
+
"private": true
|
|
1370
|
+
},
|
|
1324
1371
|
raster: {
|
|
1325
1372
|
doc: "Raster map textures such as satellite imagery.",
|
|
1326
1373
|
"sdk-support": {
|
|
@@ -1462,6 +1509,7 @@ var layout = [
|
|
|
1462
1509
|
"layout_circle",
|
|
1463
1510
|
"layout_heatmap",
|
|
1464
1511
|
"layout_fill-extrusion",
|
|
1512
|
+
"layout_building",
|
|
1465
1513
|
"layout_symbol",
|
|
1466
1514
|
"layout_raster",
|
|
1467
1515
|
"layout_raster-particle",
|
|
@@ -1859,6 +1907,115 @@ var layout_heatmap = {
|
|
|
1859
1907
|
"property-type": "constant"
|
|
1860
1908
|
}
|
|
1861
1909
|
};
|
|
1910
|
+
var layout_building = {
|
|
1911
|
+
visibility: {
|
|
1912
|
+
type: "enum",
|
|
1913
|
+
values: {
|
|
1914
|
+
visible: {
|
|
1915
|
+
doc: "The layer is shown."
|
|
1916
|
+
},
|
|
1917
|
+
none: {
|
|
1918
|
+
doc: "The layer is not shown."
|
|
1919
|
+
}
|
|
1920
|
+
},
|
|
1921
|
+
"default": "visible",
|
|
1922
|
+
doc: "Whether this layer is displayed.",
|
|
1923
|
+
"sdk-support": {
|
|
1924
|
+
"basic functionality": {
|
|
1925
|
+
}
|
|
1926
|
+
},
|
|
1927
|
+
expression: {
|
|
1928
|
+
interpolated: false
|
|
1929
|
+
},
|
|
1930
|
+
"property-type": "constant"
|
|
1931
|
+
},
|
|
1932
|
+
"building-roof-shape": {
|
|
1933
|
+
type: "enum",
|
|
1934
|
+
values: {
|
|
1935
|
+
flat: {
|
|
1936
|
+
doc: "Use regular extruded buildings with flat roofs."
|
|
1937
|
+
},
|
|
1938
|
+
hipped: {
|
|
1939
|
+
doc: "Use hipped roof for the procedurally generated buildings."
|
|
1940
|
+
},
|
|
1941
|
+
gabled: {
|
|
1942
|
+
doc: "Use gabled roof for the procedurally generated buildings."
|
|
1943
|
+
},
|
|
1944
|
+
parapet: {
|
|
1945
|
+
doc: "Use parapet roof for the procedurally generated buildings."
|
|
1946
|
+
},
|
|
1947
|
+
mansard: {
|
|
1948
|
+
doc: "Use mansard roof for the procedurally generated buildings."
|
|
1949
|
+
},
|
|
1950
|
+
skillion: {
|
|
1951
|
+
doc: "Use skillion roof for the procedurally generated buildings."
|
|
1952
|
+
},
|
|
1953
|
+
pyramidal: {
|
|
1954
|
+
doc: "Use pyramidal roof for the procedurally generated buildings."
|
|
1955
|
+
}
|
|
1956
|
+
},
|
|
1957
|
+
"default": "flat",
|
|
1958
|
+
doc: "Roof type to use for the procedural buildings.",
|
|
1959
|
+
experimental: true,
|
|
1960
|
+
"private": true,
|
|
1961
|
+
"sdk-support": {
|
|
1962
|
+
"basic functionality": {
|
|
1963
|
+
},
|
|
1964
|
+
"data-driven styling": {
|
|
1965
|
+
}
|
|
1966
|
+
},
|
|
1967
|
+
expression: {
|
|
1968
|
+
interpolated: false,
|
|
1969
|
+
parameters: [
|
|
1970
|
+
"feature"
|
|
1971
|
+
]
|
|
1972
|
+
},
|
|
1973
|
+
"property-type": "data-driven"
|
|
1974
|
+
},
|
|
1975
|
+
"building-height": {
|
|
1976
|
+
type: "number",
|
|
1977
|
+
"default": 0,
|
|
1978
|
+
minimum: 0,
|
|
1979
|
+
units: "meters",
|
|
1980
|
+
doc: "The height of the procedural buildings.",
|
|
1981
|
+
transition: true,
|
|
1982
|
+
experimental: true,
|
|
1983
|
+
"private": true,
|
|
1984
|
+
"sdk-support": {
|
|
1985
|
+
"basic functionality": {
|
|
1986
|
+
},
|
|
1987
|
+
"data-driven styling": {
|
|
1988
|
+
}
|
|
1989
|
+
},
|
|
1990
|
+
expression: {
|
|
1991
|
+
interpolated: false
|
|
1992
|
+
},
|
|
1993
|
+
"property-type": "data-driven"
|
|
1994
|
+
},
|
|
1995
|
+
"building-base": {
|
|
1996
|
+
type: "number",
|
|
1997
|
+
"default": 0,
|
|
1998
|
+
minimum: 0,
|
|
1999
|
+
units: "meters",
|
|
2000
|
+
doc: "The height with which to extrude the base of this layer. Must be less than or equal to `building-height`.",
|
|
2001
|
+
transition: true,
|
|
2002
|
+
requires: [
|
|
2003
|
+
"building-height"
|
|
2004
|
+
],
|
|
2005
|
+
experimental: true,
|
|
2006
|
+
"private": true,
|
|
2007
|
+
"sdk-support": {
|
|
2008
|
+
"basic functionality": {
|
|
2009
|
+
},
|
|
2010
|
+
"data-driven styling": {
|
|
2011
|
+
}
|
|
2012
|
+
},
|
|
2013
|
+
expression: {
|
|
2014
|
+
interpolated: false
|
|
2015
|
+
},
|
|
2016
|
+
"property-type": "data-driven"
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
1862
2019
|
var layout_line = {
|
|
1863
2020
|
"line-cap": {
|
|
1864
2021
|
type: "enum",
|
|
@@ -3800,6 +3957,20 @@ var filter_circle = {
|
|
|
3800
3957
|
]
|
|
3801
3958
|
}
|
|
3802
3959
|
};
|
|
3960
|
+
var filter_building = {
|
|
3961
|
+
type: "boolean",
|
|
3962
|
+
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.",
|
|
3963
|
+
"default": false,
|
|
3964
|
+
transition: false,
|
|
3965
|
+
"property-type": "data-driven",
|
|
3966
|
+
expression: {
|
|
3967
|
+
interpolated: false,
|
|
3968
|
+
parameters: [
|
|
3969
|
+
"zoom",
|
|
3970
|
+
"feature"
|
|
3971
|
+
]
|
|
3972
|
+
}
|
|
3973
|
+
};
|
|
3803
3974
|
var filter_heatmap = {
|
|
3804
3975
|
type: "boolean",
|
|
3805
3976
|
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.",
|
|
@@ -6105,6 +6276,7 @@ var paint = [
|
|
|
6105
6276
|
"paint_circle",
|
|
6106
6277
|
"paint_heatmap",
|
|
6107
6278
|
"paint_fill-extrusion",
|
|
6279
|
+
"paint_building",
|
|
6108
6280
|
"paint_symbol",
|
|
6109
6281
|
"paint_raster",
|
|
6110
6282
|
"paint_raster-particle",
|
|
@@ -6312,6 +6484,30 @@ var paint_fill = {
|
|
|
6312
6484
|
},
|
|
6313
6485
|
"property-type": "data-driven"
|
|
6314
6486
|
},
|
|
6487
|
+
"fill-pattern-cross-fade": {
|
|
6488
|
+
type: "number",
|
|
6489
|
+
"property-type": "data-constant",
|
|
6490
|
+
"default": 0,
|
|
6491
|
+
minimum: 0,
|
|
6492
|
+
maximum: 1,
|
|
6493
|
+
expression: {
|
|
6494
|
+
interpolated: true,
|
|
6495
|
+
parameters: [
|
|
6496
|
+
"zoom",
|
|
6497
|
+
"measure-light"
|
|
6498
|
+
]
|
|
6499
|
+
},
|
|
6500
|
+
requires: [
|
|
6501
|
+
"line-pattern"
|
|
6502
|
+
],
|
|
6503
|
+
"sdk-support": {
|
|
6504
|
+
"basic functionality": {
|
|
6505
|
+
js: "3.12.0"
|
|
6506
|
+
}
|
|
6507
|
+
},
|
|
6508
|
+
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.",
|
|
6509
|
+
transition: true
|
|
6510
|
+
},
|
|
6315
6511
|
"fill-emissive-strength": {
|
|
6316
6512
|
type: "number",
|
|
6317
6513
|
"default": 0,
|
|
@@ -6417,6 +6613,189 @@ var paint_fill = {
|
|
|
6417
6613
|
"property-type": "data-driven"
|
|
6418
6614
|
}
|
|
6419
6615
|
};
|
|
6616
|
+
var paint_building = {
|
|
6617
|
+
"building-opacity": {
|
|
6618
|
+
type: "number",
|
|
6619
|
+
"default": 1,
|
|
6620
|
+
minimum: 0,
|
|
6621
|
+
maximum: 1,
|
|
6622
|
+
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.",
|
|
6623
|
+
transition: true,
|
|
6624
|
+
experimental: true,
|
|
6625
|
+
"private": true,
|
|
6626
|
+
"sdk-support": {
|
|
6627
|
+
"basic functionality": {
|
|
6628
|
+
}
|
|
6629
|
+
},
|
|
6630
|
+
expression: {
|
|
6631
|
+
interpolated: true,
|
|
6632
|
+
parameters: [
|
|
6633
|
+
"zoom"
|
|
6634
|
+
]
|
|
6635
|
+
},
|
|
6636
|
+
"property-type": "data-constant"
|
|
6637
|
+
},
|
|
6638
|
+
"building-ambient-occlusion-wall-intensity": {
|
|
6639
|
+
"property-type": "data-constant",
|
|
6640
|
+
type: "number",
|
|
6641
|
+
"default": 0,
|
|
6642
|
+
minimum: 0,
|
|
6643
|
+
maximum: 1,
|
|
6644
|
+
experimental: true,
|
|
6645
|
+
"private": true,
|
|
6646
|
+
expression: {
|
|
6647
|
+
interpolated: true,
|
|
6648
|
+
parameters: [
|
|
6649
|
+
"zoom"
|
|
6650
|
+
]
|
|
6651
|
+
},
|
|
6652
|
+
transition: true,
|
|
6653
|
+
doc: "Controls the intensity of shading concave angles between walls and building elements, such as facades and rooftop.",
|
|
6654
|
+
"sdk-support": {
|
|
6655
|
+
"basic functionality": {
|
|
6656
|
+
}
|
|
6657
|
+
}
|
|
6658
|
+
},
|
|
6659
|
+
"building-ambient-occlusion-ground-intensity": {
|
|
6660
|
+
"property-type": "data-constant",
|
|
6661
|
+
type: "number",
|
|
6662
|
+
"default": 0,
|
|
6663
|
+
minimum: 0,
|
|
6664
|
+
maximum: 1,
|
|
6665
|
+
experimental: true,
|
|
6666
|
+
"private": true,
|
|
6667
|
+
expression: {
|
|
6668
|
+
interpolated: true,
|
|
6669
|
+
parameters: [
|
|
6670
|
+
"zoom"
|
|
6671
|
+
]
|
|
6672
|
+
},
|
|
6673
|
+
transition: true,
|
|
6674
|
+
doc: "Controls the intensity of shading near ground",
|
|
6675
|
+
"sdk-support": {
|
|
6676
|
+
"basic functionality": {
|
|
6677
|
+
}
|
|
6678
|
+
}
|
|
6679
|
+
},
|
|
6680
|
+
"building-ambient-occlusion-ground-radius": {
|
|
6681
|
+
"property-type": "data-constant",
|
|
6682
|
+
type: "number",
|
|
6683
|
+
experimental: true,
|
|
6684
|
+
"private": true,
|
|
6685
|
+
"default": 3,
|
|
6686
|
+
minimum: 0,
|
|
6687
|
+
expression: {
|
|
6688
|
+
interpolated: true,
|
|
6689
|
+
parameters: [
|
|
6690
|
+
"zoom"
|
|
6691
|
+
]
|
|
6692
|
+
},
|
|
6693
|
+
transition: true,
|
|
6694
|
+
doc: "The extent of the ambient occlusion effect on the ground beneath the procedural buildings in meters.",
|
|
6695
|
+
"sdk-support": {
|
|
6696
|
+
"basic functionality": {
|
|
6697
|
+
}
|
|
6698
|
+
}
|
|
6699
|
+
},
|
|
6700
|
+
"building-ambient-occlusion-ground-attenuation": {
|
|
6701
|
+
"property-type": "data-constant",
|
|
6702
|
+
type: "number",
|
|
6703
|
+
experimental: true,
|
|
6704
|
+
"private": true,
|
|
6705
|
+
"default": 0.69,
|
|
6706
|
+
minimum: 0,
|
|
6707
|
+
maximum: 1,
|
|
6708
|
+
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.",
|
|
6709
|
+
transition: true,
|
|
6710
|
+
expression: {
|
|
6711
|
+
interpolated: true,
|
|
6712
|
+
parameters: [
|
|
6713
|
+
"zoom"
|
|
6714
|
+
]
|
|
6715
|
+
},
|
|
6716
|
+
"sdk-support": {
|
|
6717
|
+
"basic functionality": {
|
|
6718
|
+
}
|
|
6719
|
+
}
|
|
6720
|
+
},
|
|
6721
|
+
"building-vertical-scale": {
|
|
6722
|
+
"property-type": "data-constant",
|
|
6723
|
+
type: "number",
|
|
6724
|
+
experimental: true,
|
|
6725
|
+
"private": true,
|
|
6726
|
+
"default": 1,
|
|
6727
|
+
minimum: 0,
|
|
6728
|
+
doc: "A global multiplier that can be used to scale base and height of the procedural buildings.",
|
|
6729
|
+
transition: true,
|
|
6730
|
+
expression: {
|
|
6731
|
+
interpolated: true,
|
|
6732
|
+
parameters: [
|
|
6733
|
+
"zoom"
|
|
6734
|
+
]
|
|
6735
|
+
},
|
|
6736
|
+
"sdk-support": {
|
|
6737
|
+
"basic functionality": {
|
|
6738
|
+
}
|
|
6739
|
+
}
|
|
6740
|
+
},
|
|
6741
|
+
"building-cast-shadows": {
|
|
6742
|
+
type: "boolean",
|
|
6743
|
+
"default": true,
|
|
6744
|
+
doc: "Enable/Disable shadow casting for this layer",
|
|
6745
|
+
transition: false,
|
|
6746
|
+
experimental: true,
|
|
6747
|
+
"private": true,
|
|
6748
|
+
"sdk-support": {
|
|
6749
|
+
"basic functionality": {
|
|
6750
|
+
}
|
|
6751
|
+
},
|
|
6752
|
+
"property-type": "data-constant"
|
|
6753
|
+
},
|
|
6754
|
+
"building-color": {
|
|
6755
|
+
type: "color",
|
|
6756
|
+
"default": "rgba(193, 154, 127, 1)",
|
|
6757
|
+
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`.",
|
|
6758
|
+
experimental: true,
|
|
6759
|
+
"private": true,
|
|
6760
|
+
"sdk-support": {
|
|
6761
|
+
"basic functionality": {
|
|
6762
|
+
},
|
|
6763
|
+
"data-driven styling": {
|
|
6764
|
+
}
|
|
6765
|
+
},
|
|
6766
|
+
expression: {
|
|
6767
|
+
interpolated: true,
|
|
6768
|
+
parameters: [
|
|
6769
|
+
"feature",
|
|
6770
|
+
"feature-state"
|
|
6771
|
+
]
|
|
6772
|
+
},
|
|
6773
|
+
"property-type": "data-driven"
|
|
6774
|
+
},
|
|
6775
|
+
"building-emissive-strength": {
|
|
6776
|
+
type: "number",
|
|
6777
|
+
"default": 0,
|
|
6778
|
+
minimum: 0,
|
|
6779
|
+
doc: "Controls the intensity of light emitted on the source features.",
|
|
6780
|
+
experimental: true,
|
|
6781
|
+
"private": true,
|
|
6782
|
+
"sdk-support": {
|
|
6783
|
+
"basic functionality": {
|
|
6784
|
+
},
|
|
6785
|
+
"data-driven styling": {
|
|
6786
|
+
}
|
|
6787
|
+
},
|
|
6788
|
+
expression: {
|
|
6789
|
+
interpolated: true,
|
|
6790
|
+
parameters: [
|
|
6791
|
+
"feature",
|
|
6792
|
+
"feature-state",
|
|
6793
|
+
"measure-light"
|
|
6794
|
+
]
|
|
6795
|
+
},
|
|
6796
|
+
"property-type": "data-driven"
|
|
6797
|
+
}
|
|
6798
|
+
};
|
|
6420
6799
|
var paint_line = {
|
|
6421
6800
|
"line-opacity": {
|
|
6422
6801
|
type: "number",
|
|
@@ -6713,6 +7092,30 @@ var paint_line = {
|
|
|
6713
7092
|
},
|
|
6714
7093
|
"property-type": "data-driven"
|
|
6715
7094
|
},
|
|
7095
|
+
"line-pattern-cross-fade": {
|
|
7096
|
+
type: "number",
|
|
7097
|
+
"property-type": "data-constant",
|
|
7098
|
+
"default": 0,
|
|
7099
|
+
minimum: 0,
|
|
7100
|
+
maximum: 1,
|
|
7101
|
+
expression: {
|
|
7102
|
+
interpolated: true,
|
|
7103
|
+
parameters: [
|
|
7104
|
+
"zoom",
|
|
7105
|
+
"measure-light"
|
|
7106
|
+
]
|
|
7107
|
+
},
|
|
7108
|
+
requires: [
|
|
7109
|
+
"line-pattern"
|
|
7110
|
+
],
|
|
7111
|
+
"sdk-support": {
|
|
7112
|
+
"basic functionality": {
|
|
7113
|
+
js: "3.12.0"
|
|
7114
|
+
}
|
|
7115
|
+
},
|
|
7116
|
+
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.",
|
|
7117
|
+
transition: true
|
|
7118
|
+
},
|
|
6716
7119
|
"line-gradient": {
|
|
6717
7120
|
type: "color",
|
|
6718
7121
|
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`.",
|
|
@@ -7791,7 +8194,7 @@ var paint_symbol = {
|
|
|
7791
8194
|
},
|
|
7792
8195
|
"icon-image-cross-fade": {
|
|
7793
8196
|
type: "number",
|
|
7794
|
-
"property-type": "data-
|
|
8197
|
+
"property-type": "data-constant",
|
|
7795
8198
|
"default": 0,
|
|
7796
8199
|
minimum: 0,
|
|
7797
8200
|
maximum: 1,
|
|
@@ -7799,8 +8202,6 @@ var paint_symbol = {
|
|
|
7799
8202
|
interpolated: true,
|
|
7800
8203
|
parameters: [
|
|
7801
8204
|
"zoom",
|
|
7802
|
-
"feature",
|
|
7803
|
-
"feature-state",
|
|
7804
8205
|
"measure-light"
|
|
7805
8206
|
]
|
|
7806
8207
|
},
|
|
@@ -7812,11 +8213,6 @@ var paint_symbol = {
|
|
|
7812
8213
|
js: "3.0.0",
|
|
7813
8214
|
android: "11.0.0",
|
|
7814
8215
|
ios: "11.0.0"
|
|
7815
|
-
},
|
|
7816
|
-
"data-driven styling": {
|
|
7817
|
-
js: "3.0.0",
|
|
7818
|
-
android: "11.0.0",
|
|
7819
|
-
ios: "11.0.0"
|
|
7820
8216
|
}
|
|
7821
8217
|
},
|
|
7822
8218
|
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.",
|
|
@@ -9647,6 +10043,7 @@ var v8 = {
|
|
|
9647
10043
|
"property-type": "constant"
|
|
9648
10044
|
}
|
|
9649
10045
|
},
|
|
10046
|
+
layout_building: layout_building,
|
|
9650
10047
|
layout_line: layout_line,
|
|
9651
10048
|
layout_symbol: layout_symbol,
|
|
9652
10049
|
layout_raster: layout_raster,
|
|
@@ -9719,6 +10116,7 @@ var v8 = {
|
|
|
9719
10116
|
]
|
|
9720
10117
|
}
|
|
9721
10118
|
},
|
|
10119
|
+
filter_building: filter_building,
|
|
9722
10120
|
filter_heatmap: filter_heatmap,
|
|
9723
10121
|
filter_operator: filter_operator,
|
|
9724
10122
|
geometry_type: geometry_type,
|
|
@@ -9935,6 +10333,30 @@ var v8 = {
|
|
|
9935
10333
|
},
|
|
9936
10334
|
"property-type": "data-driven"
|
|
9937
10335
|
},
|
|
10336
|
+
"fill-extrusion-pattern-cross-fade": {
|
|
10337
|
+
type: "number",
|
|
10338
|
+
"property-type": "data-constant",
|
|
10339
|
+
"default": 0,
|
|
10340
|
+
minimum: 0,
|
|
10341
|
+
maximum: 1,
|
|
10342
|
+
expression: {
|
|
10343
|
+
interpolated: true,
|
|
10344
|
+
parameters: [
|
|
10345
|
+
"zoom",
|
|
10346
|
+
"measure-light"
|
|
10347
|
+
]
|
|
10348
|
+
},
|
|
10349
|
+
requires: [
|
|
10350
|
+
"line-pattern"
|
|
10351
|
+
],
|
|
10352
|
+
"sdk-support": {
|
|
10353
|
+
"basic functionality": {
|
|
10354
|
+
js: "3.12.0"
|
|
10355
|
+
}
|
|
10356
|
+
},
|
|
10357
|
+
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.",
|
|
10358
|
+
transition: true
|
|
10359
|
+
},
|
|
9938
10360
|
"fill-extrusion-height": {
|
|
9939
10361
|
type: "number",
|
|
9940
10362
|
"default": 0,
|
|
@@ -10473,6 +10895,7 @@ var v8 = {
|
|
|
10473
10895
|
"property-type": "data-constant"
|
|
10474
10896
|
}
|
|
10475
10897
|
},
|
|
10898
|
+
paint_building: paint_building,
|
|
10476
10899
|
paint_line: paint_line,
|
|
10477
10900
|
paint_circle: paint_circle,
|
|
10478
10901
|
paint_heatmap: paint_heatmap,
|
|
@@ -12601,8 +13024,8 @@ class ImageVariant {
|
|
|
12601
13024
|
])
|
|
12602
13025
|
});
|
|
12603
13026
|
}
|
|
12604
|
-
scaleSelf(factor) {
|
|
12605
|
-
this.options.transform.scaleSelf(factor);
|
|
13027
|
+
scaleSelf(factor, yFactor) {
|
|
13028
|
+
this.options.transform.scaleSelf(factor, yFactor);
|
|
12606
13029
|
return this;
|
|
12607
13030
|
}
|
|
12608
13031
|
}
|
|
@@ -12897,6 +13320,7 @@ class Assertion {
|
|
|
12897
13320
|
}
|
|
12898
13321
|
return new Assertion(type, parsed);
|
|
12899
13322
|
}
|
|
13323
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12900
13324
|
evaluate(ctx) {
|
|
12901
13325
|
for (let i = 0; i < this.args.length; i++) {
|
|
12902
13326
|
const value = this.args[i].evaluate(ctx);
|
|
@@ -13316,6 +13740,7 @@ class Coercion {
|
|
|
13316
13740
|
}
|
|
13317
13741
|
return new Coercion(type, parsed);
|
|
13318
13742
|
}
|
|
13743
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13319
13744
|
evaluate(ctx) {
|
|
13320
13745
|
if (this.type.kind === 'boolean') {
|
|
13321
13746
|
return Boolean(this.args[0].evaluate(ctx));
|
|
@@ -13617,6 +14042,306 @@ class CollatorExpression {
|
|
|
13617
14042
|
}
|
|
13618
14043
|
}
|
|
13619
14044
|
|
|
14045
|
+
var pointGeometry;
|
|
14046
|
+
var hasRequiredPointGeometry;
|
|
14047
|
+
|
|
14048
|
+
function requirePointGeometry () {
|
|
14049
|
+
if (hasRequiredPointGeometry) return pointGeometry;
|
|
14050
|
+
hasRequiredPointGeometry = 1;
|
|
14051
|
+
pointGeometry = Point;
|
|
14052
|
+
/**
|
|
14053
|
+
* A standalone point geometry with useful accessor, comparison, and
|
|
14054
|
+
* modification methods.
|
|
14055
|
+
*
|
|
14056
|
+
* @class Point
|
|
14057
|
+
* @param {Number} x the x-coordinate. this could be longitude or screen
|
|
14058
|
+
* pixels, or any other sort of unit.
|
|
14059
|
+
* @param {Number} y the y-coordinate. this could be latitude or screen
|
|
14060
|
+
* pixels, or any other sort of unit.
|
|
14061
|
+
* @example
|
|
14062
|
+
* var point = new Point(-77, 38);
|
|
14063
|
+
*/
|
|
14064
|
+
function Point(x, y) {
|
|
14065
|
+
this.x = x;
|
|
14066
|
+
this.y = y;
|
|
14067
|
+
}
|
|
14068
|
+
Point.prototype = {
|
|
14069
|
+
/**
|
|
14070
|
+
* Clone this point, returning a new point that can be modified
|
|
14071
|
+
* without affecting the old one.
|
|
14072
|
+
* @return {Point} the clone
|
|
14073
|
+
*/
|
|
14074
|
+
clone: function () {
|
|
14075
|
+
return new Point(this.x, this.y);
|
|
14076
|
+
},
|
|
14077
|
+
/**
|
|
14078
|
+
* Add this point's x & y coordinates to another point,
|
|
14079
|
+
* yielding a new point.
|
|
14080
|
+
* @param {Point} p the other point
|
|
14081
|
+
* @return {Point} output point
|
|
14082
|
+
*/
|
|
14083
|
+
add: function (p) {
|
|
14084
|
+
return this.clone()._add(p);
|
|
14085
|
+
},
|
|
14086
|
+
/**
|
|
14087
|
+
* Subtract this point's x & y coordinates to from point,
|
|
14088
|
+
* yielding a new point.
|
|
14089
|
+
* @param {Point} p the other point
|
|
14090
|
+
* @return {Point} output point
|
|
14091
|
+
*/
|
|
14092
|
+
sub: function (p) {
|
|
14093
|
+
return this.clone()._sub(p);
|
|
14094
|
+
},
|
|
14095
|
+
/**
|
|
14096
|
+
* Multiply this point's x & y coordinates by point,
|
|
14097
|
+
* yielding a new point.
|
|
14098
|
+
* @param {Point} p the other point
|
|
14099
|
+
* @return {Point} output point
|
|
14100
|
+
*/
|
|
14101
|
+
multByPoint: function (p) {
|
|
14102
|
+
return this.clone()._multByPoint(p);
|
|
14103
|
+
},
|
|
14104
|
+
/**
|
|
14105
|
+
* Divide this point's x & y coordinates by point,
|
|
14106
|
+
* yielding a new point.
|
|
14107
|
+
* @param {Point} p the other point
|
|
14108
|
+
* @return {Point} output point
|
|
14109
|
+
*/
|
|
14110
|
+
divByPoint: function (p) {
|
|
14111
|
+
return this.clone()._divByPoint(p);
|
|
14112
|
+
},
|
|
14113
|
+
/**
|
|
14114
|
+
* Multiply this point's x & y coordinates by a factor,
|
|
14115
|
+
* yielding a new point.
|
|
14116
|
+
* @param {Point} k factor
|
|
14117
|
+
* @return {Point} output point
|
|
14118
|
+
*/
|
|
14119
|
+
mult: function (k) {
|
|
14120
|
+
return this.clone()._mult(k);
|
|
14121
|
+
},
|
|
14122
|
+
/**
|
|
14123
|
+
* Divide this point's x & y coordinates by a factor,
|
|
14124
|
+
* yielding a new point.
|
|
14125
|
+
* @param {Point} k factor
|
|
14126
|
+
* @return {Point} output point
|
|
14127
|
+
*/
|
|
14128
|
+
div: function (k) {
|
|
14129
|
+
return this.clone()._div(k);
|
|
14130
|
+
},
|
|
14131
|
+
/**
|
|
14132
|
+
* Rotate this point around the 0, 0 origin by an angle a,
|
|
14133
|
+
* given in radians
|
|
14134
|
+
* @param {Number} a angle to rotate around, in radians
|
|
14135
|
+
* @return {Point} output point
|
|
14136
|
+
*/
|
|
14137
|
+
rotate: function (a) {
|
|
14138
|
+
return this.clone()._rotate(a);
|
|
14139
|
+
},
|
|
14140
|
+
/**
|
|
14141
|
+
* Rotate this point around p point by an angle a,
|
|
14142
|
+
* given in radians
|
|
14143
|
+
* @param {Number} a angle to rotate around, in radians
|
|
14144
|
+
* @param {Point} p Point to rotate around
|
|
14145
|
+
* @return {Point} output point
|
|
14146
|
+
*/
|
|
14147
|
+
rotateAround: function (a, p) {
|
|
14148
|
+
return this.clone()._rotateAround(a, p);
|
|
14149
|
+
},
|
|
14150
|
+
/**
|
|
14151
|
+
* Multiply this point by a 4x1 transformation matrix
|
|
14152
|
+
* @param {Array<Number>} m transformation matrix
|
|
14153
|
+
* @return {Point} output point
|
|
14154
|
+
*/
|
|
14155
|
+
matMult: function (m) {
|
|
14156
|
+
return this.clone()._matMult(m);
|
|
14157
|
+
},
|
|
14158
|
+
/**
|
|
14159
|
+
* Calculate this point but as a unit vector from 0, 0, meaning
|
|
14160
|
+
* that the distance from the resulting point to the 0, 0
|
|
14161
|
+
* coordinate will be equal to 1 and the angle from the resulting
|
|
14162
|
+
* point to the 0, 0 coordinate will be the same as before.
|
|
14163
|
+
* @return {Point} unit vector point
|
|
14164
|
+
*/
|
|
14165
|
+
unit: function () {
|
|
14166
|
+
return this.clone()._unit();
|
|
14167
|
+
},
|
|
14168
|
+
/**
|
|
14169
|
+
* Compute a perpendicular point, where the new y coordinate
|
|
14170
|
+
* is the old x coordinate and the new x coordinate is the old y
|
|
14171
|
+
* coordinate multiplied by -1
|
|
14172
|
+
* @return {Point} perpendicular point
|
|
14173
|
+
*/
|
|
14174
|
+
perp: function () {
|
|
14175
|
+
return this.clone()._perp();
|
|
14176
|
+
},
|
|
14177
|
+
/**
|
|
14178
|
+
* Return a version of this point with the x & y coordinates
|
|
14179
|
+
* rounded to integers.
|
|
14180
|
+
* @return {Point} rounded point
|
|
14181
|
+
*/
|
|
14182
|
+
round: function () {
|
|
14183
|
+
return this.clone()._round();
|
|
14184
|
+
},
|
|
14185
|
+
/**
|
|
14186
|
+
* Return the magitude of this point: this is the Euclidean
|
|
14187
|
+
* distance from the 0, 0 coordinate to this point's x and y
|
|
14188
|
+
* coordinates.
|
|
14189
|
+
* @return {Number} magnitude
|
|
14190
|
+
*/
|
|
14191
|
+
mag: function () {
|
|
14192
|
+
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
14193
|
+
},
|
|
14194
|
+
/**
|
|
14195
|
+
* Judge whether this point is equal to another point, returning
|
|
14196
|
+
* true or false.
|
|
14197
|
+
* @param {Point} other the other point
|
|
14198
|
+
* @return {boolean} whether the points are equal
|
|
14199
|
+
*/
|
|
14200
|
+
equals: function (other) {
|
|
14201
|
+
return this.x === other.x && this.y === other.y;
|
|
14202
|
+
},
|
|
14203
|
+
/**
|
|
14204
|
+
* Calculate the distance from this point to another point
|
|
14205
|
+
* @param {Point} p the other point
|
|
14206
|
+
* @return {Number} distance
|
|
14207
|
+
*/
|
|
14208
|
+
dist: function (p) {
|
|
14209
|
+
return Math.sqrt(this.distSqr(p));
|
|
14210
|
+
},
|
|
14211
|
+
/**
|
|
14212
|
+
* Calculate the distance from this point to another point,
|
|
14213
|
+
* without the square root step. Useful if you're comparing
|
|
14214
|
+
* relative distances.
|
|
14215
|
+
* @param {Point} p the other point
|
|
14216
|
+
* @return {Number} distance
|
|
14217
|
+
*/
|
|
14218
|
+
distSqr: function (p) {
|
|
14219
|
+
var dx = p.x - this.x, dy = p.y - this.y;
|
|
14220
|
+
return dx * dx + dy * dy;
|
|
14221
|
+
},
|
|
14222
|
+
/**
|
|
14223
|
+
* Get the angle from the 0, 0 coordinate to this point, in radians
|
|
14224
|
+
* coordinates.
|
|
14225
|
+
* @return {Number} angle
|
|
14226
|
+
*/
|
|
14227
|
+
angle: function () {
|
|
14228
|
+
return Math.atan2(this.y, this.x);
|
|
14229
|
+
},
|
|
14230
|
+
/**
|
|
14231
|
+
* Get the angle from this point to another point, in radians
|
|
14232
|
+
* @param {Point} b the other point
|
|
14233
|
+
* @return {Number} angle
|
|
14234
|
+
*/
|
|
14235
|
+
angleTo: function (b) {
|
|
14236
|
+
return Math.atan2(this.y - b.y, this.x - b.x);
|
|
14237
|
+
},
|
|
14238
|
+
/**
|
|
14239
|
+
* Get the angle between this point and another point, in radians
|
|
14240
|
+
* @param {Point} b the other point
|
|
14241
|
+
* @return {Number} angle
|
|
14242
|
+
*/
|
|
14243
|
+
angleWith: function (b) {
|
|
14244
|
+
return this.angleWithSep(b.x, b.y);
|
|
14245
|
+
},
|
|
14246
|
+
/*
|
|
14247
|
+
* Find the angle of the two vectors, solving the formula for
|
|
14248
|
+
* the cross product a x b = |a||b|sin(θ) for θ.
|
|
14249
|
+
* @param {Number} x the x-coordinate
|
|
14250
|
+
* @param {Number} y the y-coordinate
|
|
14251
|
+
* @return {Number} the angle in radians
|
|
14252
|
+
*/
|
|
14253
|
+
angleWithSep: function (x, y) {
|
|
14254
|
+
return Math.atan2(this.x * y - this.y * x, this.x * x + this.y * y);
|
|
14255
|
+
},
|
|
14256
|
+
_matMult: function (m) {
|
|
14257
|
+
var x = m[0] * this.x + m[1] * this.y, y = m[2] * this.x + m[3] * this.y;
|
|
14258
|
+
this.x = x;
|
|
14259
|
+
this.y = y;
|
|
14260
|
+
return this;
|
|
14261
|
+
},
|
|
14262
|
+
_add: function (p) {
|
|
14263
|
+
this.x += p.x;
|
|
14264
|
+
this.y += p.y;
|
|
14265
|
+
return this;
|
|
14266
|
+
},
|
|
14267
|
+
_sub: function (p) {
|
|
14268
|
+
this.x -= p.x;
|
|
14269
|
+
this.y -= p.y;
|
|
14270
|
+
return this;
|
|
14271
|
+
},
|
|
14272
|
+
_mult: function (k) {
|
|
14273
|
+
this.x *= k;
|
|
14274
|
+
this.y *= k;
|
|
14275
|
+
return this;
|
|
14276
|
+
},
|
|
14277
|
+
_div: function (k) {
|
|
14278
|
+
this.x /= k;
|
|
14279
|
+
this.y /= k;
|
|
14280
|
+
return this;
|
|
14281
|
+
},
|
|
14282
|
+
_multByPoint: function (p) {
|
|
14283
|
+
this.x *= p.x;
|
|
14284
|
+
this.y *= p.y;
|
|
14285
|
+
return this;
|
|
14286
|
+
},
|
|
14287
|
+
_divByPoint: function (p) {
|
|
14288
|
+
this.x /= p.x;
|
|
14289
|
+
this.y /= p.y;
|
|
14290
|
+
return this;
|
|
14291
|
+
},
|
|
14292
|
+
_unit: function () {
|
|
14293
|
+
this._div(this.mag());
|
|
14294
|
+
return this;
|
|
14295
|
+
},
|
|
14296
|
+
_perp: function () {
|
|
14297
|
+
var y = this.y;
|
|
14298
|
+
this.y = this.x;
|
|
14299
|
+
this.x = -y;
|
|
14300
|
+
return this;
|
|
14301
|
+
},
|
|
14302
|
+
_rotate: function (angle) {
|
|
14303
|
+
var cos = Math.cos(angle), sin = Math.sin(angle), x = cos * this.x - sin * this.y, y = sin * this.x + cos * this.y;
|
|
14304
|
+
this.x = x;
|
|
14305
|
+
this.y = y;
|
|
14306
|
+
return this;
|
|
14307
|
+
},
|
|
14308
|
+
_rotateAround: function (angle, p) {
|
|
14309
|
+
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);
|
|
14310
|
+
this.x = x;
|
|
14311
|
+
this.y = y;
|
|
14312
|
+
return this;
|
|
14313
|
+
},
|
|
14314
|
+
_round: function () {
|
|
14315
|
+
this.x = Math.round(this.x);
|
|
14316
|
+
this.y = Math.round(this.y);
|
|
14317
|
+
return this;
|
|
14318
|
+
}
|
|
14319
|
+
};
|
|
14320
|
+
/**
|
|
14321
|
+
* Construct a point from an array if necessary, otherwise if the input
|
|
14322
|
+
* is already a Point, or an unknown type, return it unchanged
|
|
14323
|
+
* @param {Array<Number>|Point|*} a any kind of input value
|
|
14324
|
+
* @return {Point} constructed point, or passed-through value.
|
|
14325
|
+
* @example
|
|
14326
|
+
* // this
|
|
14327
|
+
* var point = Point.convert([0, 1]);
|
|
14328
|
+
* // is equivalent to
|
|
14329
|
+
* var point = new Point(0, 1);
|
|
14330
|
+
*/
|
|
14331
|
+
Point.convert = function (a) {
|
|
14332
|
+
if (a instanceof Point) {
|
|
14333
|
+
return a;
|
|
14334
|
+
}
|
|
14335
|
+
if (Array.isArray(a)) {
|
|
14336
|
+
return new Point(a[0], a[1]);
|
|
14337
|
+
}
|
|
14338
|
+
return a;
|
|
14339
|
+
};
|
|
14340
|
+
return pointGeometry;
|
|
14341
|
+
}
|
|
14342
|
+
|
|
14343
|
+
requirePointGeometry();
|
|
14344
|
+
|
|
13620
14345
|
function calculateSignedArea(ring) {
|
|
13621
14346
|
let sum = 0;
|
|
13622
14347
|
for (let i = 0, len = ring.length, j = len - 1, p1, p2; i < len; j = i++) {
|
|
@@ -15152,6 +15877,7 @@ class Config {
|
|
|
15152
15877
|
}
|
|
15153
15878
|
return new Config(type, toString(configKey.value));
|
|
15154
15879
|
}
|
|
15880
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15155
15881
|
evaluate(ctx) {
|
|
15156
15882
|
const FQIDSeparator = '\x1F';
|
|
15157
15883
|
const configKey = [
|
|
@@ -15296,6 +16022,7 @@ class Var {
|
|
|
15296
16022
|
}
|
|
15297
16023
|
return new Var(name, context.scope.get(name));
|
|
15298
16024
|
}
|
|
16025
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15299
16026
|
evaluate(ctx) {
|
|
15300
16027
|
return this.boundExpression.evaluate(ctx);
|
|
15301
16028
|
}
|
|
@@ -15561,6 +16288,7 @@ class Step {
|
|
|
15561
16288
|
}
|
|
15562
16289
|
return new Step(outputType, input, stops);
|
|
15563
16290
|
}
|
|
16291
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15564
16292
|
evaluate(ctx) {
|
|
15565
16293
|
const labels = this.labels;
|
|
15566
16294
|
const outputs = this.outputs;
|
|
@@ -15963,6 +16691,7 @@ class Coalesce {
|
|
|
15963
16691
|
const needsAnnotation = expectedType && parsedArgs.some(arg => checkSubtype(expectedType, arg.type));
|
|
15964
16692
|
return needsAnnotation ? new Coalesce(ValueType, parsedArgs) : new Coalesce(outputType, parsedArgs);
|
|
15965
16693
|
}
|
|
16694
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15966
16695
|
evaluate(ctx) {
|
|
15967
16696
|
let result = null;
|
|
15968
16697
|
let argCount = 0;
|
|
@@ -16005,6 +16734,7 @@ class Let {
|
|
|
16005
16734
|
this.bindings = [].concat(bindings);
|
|
16006
16735
|
this.result = result;
|
|
16007
16736
|
}
|
|
16737
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16008
16738
|
evaluate(ctx) {
|
|
16009
16739
|
return this.result.evaluate(ctx);
|
|
16010
16740
|
}
|
|
@@ -16247,6 +16977,7 @@ class IndexOf {
|
|
|
16247
16977
|
return new IndexOf(needle, haystack);
|
|
16248
16978
|
}
|
|
16249
16979
|
}
|
|
16980
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16250
16981
|
evaluate(ctx) {
|
|
16251
16982
|
const needle = this.needle.evaluate(ctx);
|
|
16252
16983
|
const haystack = this.haystack.evaluate(ctx);
|
|
@@ -16363,6 +17094,7 @@ class Match {
|
|
|
16363
17094
|
}
|
|
16364
17095
|
return new Match(inputType, outputType, input, cases, outputs, otherwise);
|
|
16365
17096
|
}
|
|
17097
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16366
17098
|
evaluate(ctx) {
|
|
16367
17099
|
const input = this.input.evaluate(ctx);
|
|
16368
17100
|
const output = typeOf(input) === this.inputType && this.outputs[this.cases[input]] || this.otherwise;
|
|
@@ -16444,6 +17176,7 @@ class Case {
|
|
|
16444
17176
|
return null;
|
|
16445
17177
|
return new Case(outputType, branches, otherwise);
|
|
16446
17178
|
}
|
|
17179
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16447
17180
|
evaluate(ctx) {
|
|
16448
17181
|
for (const [test, expression] of this.branches) {
|
|
16449
17182
|
if (test.evaluate(ctx)) {
|
|
@@ -16502,6 +17235,7 @@ class Slice {
|
|
|
16502
17235
|
return new Slice(input.type, input, beginIndex);
|
|
16503
17236
|
}
|
|
16504
17237
|
}
|
|
17238
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16505
17239
|
evaluate(ctx) {
|
|
16506
17240
|
const input = this.input.evaluate(ctx);
|
|
16507
17241
|
const beginIndex = this.beginIndex.evaluate(ctx);
|
|
@@ -17022,6 +17756,7 @@ CompoundExpression.register(expressions, {
|
|
|
17022
17756
|
overloads: [
|
|
17023
17757
|
[
|
|
17024
17758
|
[StringType],
|
|
17759
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17025
17760
|
(ctx, [key]) => get(key.evaluate(ctx), ctx.properties())
|
|
17026
17761
|
],
|
|
17027
17762
|
[
|
|
@@ -17029,6 +17764,7 @@ CompoundExpression.register(expressions, {
|
|
|
17029
17764
|
StringType,
|
|
17030
17765
|
ObjectType
|
|
17031
17766
|
],
|
|
17767
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17032
17768
|
(ctx, [key, obj]) => get(key.evaluate(ctx), obj.evaluate(ctx))
|
|
17033
17769
|
]
|
|
17034
17770
|
]
|
|
@@ -17036,6 +17772,7 @@ CompoundExpression.register(expressions, {
|
|
|
17036
17772
|
'feature-state': [
|
|
17037
17773
|
ValueType,
|
|
17038
17774
|
[StringType],
|
|
17775
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17039
17776
|
(ctx, [key]) => get(key.evaluate(ctx), ctx.featureState || {})
|
|
17040
17777
|
],
|
|
17041
17778
|
'properties': [
|
|
@@ -17233,11 +17970,13 @@ CompoundExpression.register(expressions, {
|
|
|
17233
17970
|
'min': [
|
|
17234
17971
|
NumberType,
|
|
17235
17972
|
varargs(NumberType),
|
|
17973
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17236
17974
|
(ctx, args) => Math.min(...args.map(arg => arg.evaluate(ctx)))
|
|
17237
17975
|
],
|
|
17238
17976
|
'max': [
|
|
17239
17977
|
NumberType,
|
|
17240
17978
|
varargs(NumberType),
|
|
17979
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17241
17980
|
(ctx, args) => Math.max(...args.map(arg => arg.evaluate(ctx)))
|
|
17242
17981
|
],
|
|
17243
17982
|
'abs': [
|
|
@@ -17411,6 +18150,7 @@ CompoundExpression.register(expressions, {
|
|
|
17411
18150
|
BooleanType,
|
|
17412
18151
|
BooleanType
|
|
17413
18152
|
],
|
|
18153
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17414
18154
|
(ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx)
|
|
17415
18155
|
],
|
|
17416
18156
|
[
|
|
@@ -17433,6 +18173,7 @@ CompoundExpression.register(expressions, {
|
|
|
17433
18173
|
BooleanType,
|
|
17434
18174
|
BooleanType
|
|
17435
18175
|
],
|
|
18176
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17436
18177
|
(ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx)
|
|
17437
18178
|
],
|
|
17438
18179
|
[
|
|
@@ -17467,11 +18208,13 @@ CompoundExpression.register(expressions, {
|
|
|
17467
18208
|
'upcase': [
|
|
17468
18209
|
StringType,
|
|
17469
18210
|
[StringType],
|
|
18211
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17470
18212
|
(ctx, [s]) => s.evaluate(ctx).toUpperCase()
|
|
17471
18213
|
],
|
|
17472
18214
|
'downcase': [
|
|
17473
18215
|
StringType,
|
|
17474
18216
|
[StringType],
|
|
18217
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17475
18218
|
(ctx, [s]) => s.evaluate(ctx).toLowerCase()
|
|
17476
18219
|
],
|
|
17477
18220
|
'concat': [
|
|
@@ -17482,6 +18225,7 @@ CompoundExpression.register(expressions, {
|
|
|
17482
18225
|
'resolved-locale': [
|
|
17483
18226
|
StringType,
|
|
17484
18227
|
[CollatorType],
|
|
18228
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17485
18229
|
(ctx, [collator]) => collator.evaluate(ctx).resolvedLocale()
|
|
17486
18230
|
],
|
|
17487
18231
|
'random': [
|
|
@@ -17629,6 +18373,7 @@ function createFunction(parameters, propertySpec) {
|
|
|
17629
18373
|
kind: 'composite',
|
|
17630
18374
|
interpolationType,
|
|
17631
18375
|
interpolationFactor: Interpolate.interpolationFactor.bind(void 0, interpolationType),
|
|
18376
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17632
18377
|
zoomStops: featureFunctionStops.map(s => s[0]),
|
|
17633
18378
|
evaluate({zoom}, properties) {
|
|
17634
18379
|
return evaluateExponentialFunction({
|
|
@@ -17646,7 +18391,9 @@ function createFunction(parameters, propertySpec) {
|
|
|
17646
18391
|
kind: 'camera',
|
|
17647
18392
|
interpolationType,
|
|
17648
18393
|
interpolationFactor: Interpolate.interpolationFactor.bind(void 0, interpolationType),
|
|
18394
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17649
18395
|
zoomStops: parameters.stops.map(s => s[0]),
|
|
18396
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17650
18397
|
evaluate: ({zoom}) => innerFun(parameters, propertySpec, zoom, hashedStops, categoricalKeyType)
|
|
17651
18398
|
};
|
|
17652
18399
|
} else {
|
|
@@ -18752,7 +19499,8 @@ function convertInOp(property, values, negate = false) {
|
|
|
18752
19499
|
negate
|
|
18753
19500
|
];
|
|
18754
19501
|
}
|
|
18755
|
-
return [negate ? 'all' : 'any'].concat(
|
|
19502
|
+
return [negate ? 'all' : 'any'].concat(// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19503
|
+
values.map(v => [
|
|
18756
19504
|
negate ? '!=' : '==',
|
|
18757
19505
|
get,
|
|
18758
19506
|
v
|
|
@@ -19037,7 +19785,15 @@ const operations = {
|
|
|
19037
19785
|
/**
|
|
19038
19786
|
* { command: 'updateImport', args: [importId, importSpecification | styleUrl] }
|
|
19039
19787
|
*/
|
|
19040
|
-
updateImport: 'updateImport'
|
|
19788
|
+
updateImport: 'updateImport',
|
|
19789
|
+
/*
|
|
19790
|
+
* { command: 'addIconset', args: [iconsetId, IconsetSpecification] }
|
|
19791
|
+
*/
|
|
19792
|
+
addIconset: 'addIconset',
|
|
19793
|
+
/*
|
|
19794
|
+
* { command: 'removeIconset', args: [iconsetId] }
|
|
19795
|
+
*/
|
|
19796
|
+
removeIconset: 'removeIconset'
|
|
19041
19797
|
};
|
|
19042
19798
|
function addSource(sourceId, after, commands) {
|
|
19043
19799
|
commands.push({
|
|
@@ -19344,6 +20100,47 @@ function diffImports(before = [], after = [], commands) {
|
|
|
19344
20100
|
});
|
|
19345
20101
|
}
|
|
19346
20102
|
}
|
|
20103
|
+
function diffIconsets(before, after, commands) {
|
|
20104
|
+
before = before || {};
|
|
20105
|
+
after = after || {};
|
|
20106
|
+
let iconsetId;
|
|
20107
|
+
for (iconsetId in before) {
|
|
20108
|
+
if (!before.hasOwnProperty(iconsetId))
|
|
20109
|
+
continue;
|
|
20110
|
+
if (!after.hasOwnProperty(iconsetId)) {
|
|
20111
|
+
commands.push({
|
|
20112
|
+
command: operations.removeIconset,
|
|
20113
|
+
args: [iconsetId]
|
|
20114
|
+
});
|
|
20115
|
+
}
|
|
20116
|
+
}
|
|
20117
|
+
for (iconsetId in after) {
|
|
20118
|
+
if (!after.hasOwnProperty(iconsetId))
|
|
20119
|
+
continue;
|
|
20120
|
+
const iconset = after[iconsetId];
|
|
20121
|
+
if (!before.hasOwnProperty(iconsetId)) {
|
|
20122
|
+
commands.push({
|
|
20123
|
+
command: operations.addIconset,
|
|
20124
|
+
args: [
|
|
20125
|
+
iconsetId,
|
|
20126
|
+
iconset
|
|
20127
|
+
]
|
|
20128
|
+
});
|
|
20129
|
+
} else if (!deepEqual(before[iconsetId], iconset)) {
|
|
20130
|
+
commands.push({
|
|
20131
|
+
command: operations.removeIconset,
|
|
20132
|
+
args: [iconsetId]
|
|
20133
|
+
});
|
|
20134
|
+
commands.push({
|
|
20135
|
+
command: operations.addIconset,
|
|
20136
|
+
args: [
|
|
20137
|
+
iconsetId,
|
|
20138
|
+
iconset
|
|
20139
|
+
]
|
|
20140
|
+
});
|
|
20141
|
+
}
|
|
20142
|
+
}
|
|
20143
|
+
}
|
|
19347
20144
|
function diffStyles(before, after) {
|
|
19348
20145
|
if (!before)
|
|
19349
20146
|
return [{
|
|
@@ -19445,6 +20242,9 @@ function diffStyles(before, after) {
|
|
|
19445
20242
|
args: [after.camera]
|
|
19446
20243
|
});
|
|
19447
20244
|
}
|
|
20245
|
+
if (!deepEqual(before.iconsets, after.iconsets)) {
|
|
20246
|
+
diffIconsets(before.iconsets, after.iconsets, commands);
|
|
20247
|
+
}
|
|
19448
20248
|
if (!deepEqual(before['color-theme'], after['color-theme'])) {
|
|
19449
20249
|
return [{
|
|
19450
20250
|
command: operations.setStyle,
|
|
@@ -20198,8 +20998,8 @@ function validateLayer(options) {
|
|
|
20198
20998
|
'raster-particle'
|
|
20199
20999
|
].includes(type)) {
|
|
20200
21000
|
errors.push(new ValidationError(key, layer.source, `raster-array source can only be used with layer type 'raster'.`));
|
|
20201
|
-
} else if (type === 'line' && layer.paint && (layer.paint['line-gradient'] || layer.paint['line-trim-offset']) && (sourceType
|
|
20202
|
-
errors.push(new ValidationError(key, layer, `layer "${ layer.id }" specifies a line-gradient, which requires
|
|
21001
|
+
} else if (type === 'line' && layer.paint && (layer.paint['line-gradient'] || layer.paint['line-trim-offset']) && (sourceType === 'geojson' && !source.lineMetrics)) {
|
|
21002
|
+
errors.push(new ValidationError(key, layer, `layer "${ layer.id }" specifies a line-gradient, which requires the GeoJSON source to have \`lineMetrics\` enabled.`));
|
|
20203
21003
|
} else if (type === 'raster-particle' && sourceType !== 'raster-array') {
|
|
20204
21004
|
errors.push(new ValidationError(key, layer.source, `layer "${ layer.id }" requires a 'raster-array' source.`));
|
|
20205
21005
|
}
|
|
@@ -21956,7 +22756,7 @@ function isValid(value, regex) {
|
|
|
21956
22756
|
return !!value.match(regex);
|
|
21957
22757
|
}
|
|
21958
22758
|
function getSourceCount(source) {
|
|
21959
|
-
if (source
|
|
22759
|
+
if ('url' in source) {
|
|
21960
22760
|
return source.url.split(',').length;
|
|
21961
22761
|
} else {
|
|
21962
22762
|
return 0;
|
|
@@ -21995,7 +22795,7 @@ function getSourceErrors(source, i) {
|
|
|
21995
22795
|
errors.push(new ValidationError(`sources[${ i }].type`, source.type, `Expected one of [${ Array.from(acceptedSourceTypes).join(', ') }]`));
|
|
21996
22796
|
}
|
|
21997
22797
|
const sourceUrlPattern = /^mapbox:\/\/([^/]*)$/;
|
|
21998
|
-
if (!
|
|
22798
|
+
if (!('url' in source) || !isValid(source.url, sourceUrlPattern)) {
|
|
21999
22799
|
errors.push(new ValidationError(`sources[${ i }].url`, source.url, 'Expected a valid Mapbox tileset url'));
|
|
22000
22800
|
}
|
|
22001
22801
|
return errors;
|