@mapbox/mapbox-gl-style-spec 13.25.0 → 13.26.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/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 13.26.0
2
+
3
+ ### Features ✨
4
+
5
+ * Add unit option to number-format expression ([#11839](https://github.com/mapbox/mapbox-gl-js/pull/11839)) (h/t [varna](https://github.com/varna))
6
+
7
+ ## Bug fixes 🐞
8
+ * Fix a bug where `id` expression didn't correctly handle a value of 0 ([#12000](https://github.com/mapbox/mapbox-gl-js/pull/12000))
9
+
1
10
  ## 13.25.0
2
11
 
3
12
  ### Features ✨
package/dist/index.cjs CHANGED
@@ -2977,7 +2977,7 @@
2977
2977
  }
2978
2978
  },
2979
2979
  "number-format": {
2980
- doc: "Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",
2980
+ doc: "Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",
2981
2981
  group: "Types",
2982
2982
  "sdk-support": {
2983
2983
  "basic functionality": {
@@ -3667,7 +3667,9 @@
3667
3667
  "sdk-support": {
3668
3668
  "basic functionality": {
3669
3669
  js: "0.45.0",
3670
- android: "6.6.0"
3670
+ android: "6.6.0",
3671
+ ios: "4.1.0",
3672
+ macos: "0.8.0"
3671
3673
  }
3672
3674
  }
3673
3675
  },
@@ -6394,6 +6396,20 @@
6394
6396
  }
6395
6397
  },
6396
6398
  "property-type": "constant"
6399
+ },
6400
+ "fill-extrusion-edge-radius": {
6401
+ type: "number",
6402
+ "private": true,
6403
+ "default": 0,
6404
+ minimum: 0,
6405
+ maximum: 1,
6406
+ doc: "Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.",
6407
+ "sdk-support": {
6408
+ "basic functionality": {
6409
+ js: "v2.10.0"
6410
+ }
6411
+ },
6412
+ "property-type": "constant"
6397
6413
  }
6398
6414
  },
6399
6415
  layout_line: layout_line,
@@ -6721,6 +6737,51 @@
6721
6737
  ]
6722
6738
  },
6723
6739
  "property-type": "data-constant"
6740
+ },
6741
+ "fill-extrusion-ambient-occlusion-intensity": {
6742
+ "property-type": "data-constant",
6743
+ type: "number",
6744
+ "private": true,
6745
+ "default": 0,
6746
+ minimum: 0,
6747
+ maximum: 1,
6748
+ expression: {
6749
+ interpolated: true,
6750
+ parameters: [
6751
+ "zoom"
6752
+ ]
6753
+ },
6754
+ transition: true,
6755
+ doc: "Controls the intensity of ambient occlusion (AO) shading. Current AO implementation is a low-cost best-effort approach that shades area near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.",
6756
+ "sdk-support": {
6757
+ "basic functionality": {
6758
+ js: "2.10.0",
6759
+ android: "10.7.0",
6760
+ ios: "10.7.0"
6761
+ }
6762
+ }
6763
+ },
6764
+ "fill-extrusion-ambient-occlusion-radius": {
6765
+ "property-type": "data-constant",
6766
+ type: "number",
6767
+ "private": true,
6768
+ "default": 3,
6769
+ minimum: 0,
6770
+ expression: {
6771
+ interpolated: true,
6772
+ parameters: [
6773
+ "zoom"
6774
+ ]
6775
+ },
6776
+ transition: true,
6777
+ doc: "The radius of ambient occlusion (AO) shading, in meters. Current AO implementation is a low-cost best-effort approach that shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to hight of one floor and brings the most plausible results for buildings.",
6778
+ "sdk-support": {
6779
+ "basic functionality": {
6780
+ js: "2.10.0",
6781
+ android: "10.7.0",
6782
+ ios: "10.7.0"
6783
+ }
6784
+ }
6724
6785
  }
6725
6786
  },
6726
6787
  paint_line: paint_line,
@@ -9469,7 +9530,7 @@
9469
9530
  this.featureDistanceData = null;
9470
9531
  }
9471
9532
  id() {
9472
- return this.feature && 'id' in this.feature && this.feature.id ? this.feature.id : null;
9533
+ return this.feature && this.feature.id !== undefined ? this.feature.id : null;
9473
9534
  }
9474
9535
  geometryType() {
9475
9536
  return this.feature ? typeof this.feature.type === 'number' ? geometryTypes[this.feature.type] : this.feature.type : null;
@@ -11403,11 +11464,12 @@
11403
11464
  const GreaterThanOrEqual = makeComparison('>=', gteq, gteqCollate);
11404
11465
 
11405
11466
  class NumberFormat {
11406
- constructor(number, locale, currency, minFractionDigits, maxFractionDigits) {
11467
+ constructor(number, locale, currency, unit, minFractionDigits, maxFractionDigits) {
11407
11468
  this.type = StringType;
11408
11469
  this.number = number;
11409
11470
  this.locale = locale;
11410
11471
  this.currency = currency;
11472
+ this.unit = unit;
11411
11473
  this.minFractionDigits = minFractionDigits;
11412
11474
  this.maxFractionDigits = maxFractionDigits;
11413
11475
  }
@@ -11432,6 +11494,12 @@
11432
11494
  if (!currency)
11433
11495
  return null;
11434
11496
  }
11497
+ let unit = null;
11498
+ if (options['unit']) {
11499
+ unit = context.parse(options['unit'], 1, StringType);
11500
+ if (!unit)
11501
+ return null;
11502
+ }
11435
11503
  let minFractionDigits = null;
11436
11504
  if (options['min-fraction-digits']) {
11437
11505
  minFractionDigits = context.parse(options['min-fraction-digits'], 1, NumberType);
@@ -11444,12 +11512,13 @@
11444
11512
  if (!maxFractionDigits)
11445
11513
  return null;
11446
11514
  }
11447
- return new NumberFormat(number, locale, currency, minFractionDigits, maxFractionDigits);
11515
+ return new NumberFormat(number, locale, currency, unit, minFractionDigits, maxFractionDigits);
11448
11516
  }
11449
11517
  evaluate(ctx) {
11450
11518
  return new Intl.NumberFormat(this.locale ? this.locale.evaluate(ctx) : [], {
11451
- style: this.currency ? 'currency' : 'decimal',
11519
+ style: this.currency && 'currency' || this.unit && 'unit' || 'decimal',
11452
11520
  currency: this.currency ? this.currency.evaluate(ctx) : undefined,
11521
+ unit: this.unit ? this.unit.evaluate(ctx) : undefined,
11453
11522
  minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(ctx) : undefined,
11454
11523
  maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(ctx) : undefined
11455
11524
  }).format(this.number.evaluate(ctx));
@@ -11462,6 +11531,9 @@
11462
11531
  if (this.currency) {
11463
11532
  fn(this.currency);
11464
11533
  }
11534
+ if (this.unit) {
11535
+ fn(this.unit);
11536
+ }
11465
11537
  if (this.minFractionDigits) {
11466
11538
  fn(this.minFractionDigits);
11467
11539
  }
@@ -11480,6 +11552,9 @@
11480
11552
  if (this.currency) {
11481
11553
  options['currency'] = this.currency.serialize();
11482
11554
  }
11555
+ if (this.unit) {
11556
+ options['unit'] = this.unit.serialize();
11557
+ }
11483
11558
  if (this.minFractionDigits) {
11484
11559
  options['min-fraction-digits'] = this.minFractionDigits.serialize();
11485
11560
  }