@mapbox/mapbox-gl-style-spec 14.17.0-beta.1 → 14.17.0-beta.2

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.
@@ -18,7 +18,8 @@ export type StringifiedImageVariant = Brand<string, 'ImageVariant'>;
18
18
  */
19
19
  export type RasterizationOptions = {
20
20
  params?: Record<string, Color>;
21
- transform?: DOMMatrix;
21
+ sx?: number;
22
+ sy?: number;
22
23
  };
23
24
 
24
25
  /**
@@ -28,55 +29,42 @@ export type RasterizationOptions = {
28
29
  *
29
30
  * @private
30
31
  */
31
- export class ImageVariant {
32
+ export class ImageVariant implements RasterizationOptions {
32
33
  id: ImageId;
33
- options: RasterizationOptions;
34
+ params?: Record<string, Color>;
35
+ sx: number;
36
+ sy: number;
34
37
 
35
38
  constructor(id: string | ImageIdSpec, options: RasterizationOptions = {}) {
36
39
  this.id = ImageId.from(id);
37
- this.options = Object.assign({}, options);
38
-
39
- if (!options.transform) {
40
- this.options.transform = new DOMMatrix([1, 0, 0, 1, 0, 0]);
41
- } else {
42
- const {a, b, c, d, e, f} = options.transform;
43
- this.options.transform = new DOMMatrix([a, b, c, d, e, f]);
44
- }
40
+ this.params = options.params;
41
+ this.sx = options.sx || 1;
42
+ this.sy = options.sy || 1;
45
43
  }
46
44
 
47
45
  toString(): StringifiedImageVariant {
48
- const {a, b, c, d, e, f} = this.options.transform;
49
-
50
- const serialized = {
51
- name: this.id.name,
52
- iconsetId: this.id.iconsetId,
53
- params: this.options.params,
54
- transform: {a, b, c, d, e, f},
55
- };
56
-
57
- return JSON.stringify(serialized) as StringifiedImageVariant;
46
+ return JSON.stringify(this) as StringifiedImageVariant;
58
47
  }
59
48
 
60
49
  static parse(str: StringifiedImageVariant): ImageVariant | null {
61
- let name, iconsetId, params, transform;
50
+ let id, params, sx, sy;
62
51
 
63
52
  try {
64
53
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
65
- ({name, iconsetId, params, transform} = JSON.parse(str) || {});
54
+ ({id, params, sx, sy} = JSON.parse(str) || {});
66
55
  } catch (e) {
67
56
  return null;
68
57
  }
69
58
 
70
- if (!name) return null;
59
+ if (!id) return null;
71
60
 
72
61
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
73
- const {a, b, c, d, e, f} = transform || {};
74
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
75
- return new ImageVariant({name, iconsetId}, {params, transform: new DOMMatrix([a, b, c, d, e, f])});
62
+ return new ImageVariant(id as ImageIdSpec, {params, sx, sy});
76
63
  }
77
64
 
78
- scaleSelf(factor: number, yFactor?: number): this {
79
- this.options.transform.scaleSelf(factor, yFactor);
65
+ scaleSelf(factor: number, yFactor: number = factor): this {
66
+ this.sx *= factor;
67
+ this.sy *= yFactor;
80
68
  return this;
81
69
  }
82
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapbox/mapbox-gl-style-spec",
3
- "version": "14.17.0-beta.1",
3
+ "version": "14.17.0-beta.2",
4
4
  "description": "a specification for mapbox gl styles",
5
5
  "author": "Mapbox",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
package/reference/v8.json CHANGED
@@ -846,7 +846,6 @@
846
846
  "length": 4,
847
847
  "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]`."
848
848
  },
849
- "experimental": true,
850
849
  "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."
851
850
  },
852
851
  "scheme": {
@@ -936,7 +935,6 @@
936
935
  "length": 4,
937
936
  "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]`."
938
937
  },
939
- "experimental": true,
940
938
  "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."
941
939
  },
942
940
  "minzoom": {
@@ -1028,7 +1026,6 @@
1028
1026
  "length": 4,
1029
1027
  "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]`."
1030
1028
  },
1031
- "experimental": true,
1032
1029
  "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."
1033
1030
  },
1034
1031
  "minzoom": {
@@ -1121,7 +1118,6 @@
1121
1118
  "length": 4,
1122
1119
  "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]`."
1123
1120
  },
1124
- "experimental": true,
1125
1121
  "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."
1126
1122
  },
1127
1123
  "minzoom": {
@@ -3624,6 +3620,7 @@
3624
3620
  "requires": [
3625
3621
  "text-field"
3626
3622
  ],
3623
+ "appearance": true,
3627
3624
  "sdk-support": {
3628
3625
  "basic functionality": {
3629
3626
  "js": "0.10.0",
@@ -4021,6 +4018,7 @@
4021
4018
  "requires": [
4022
4019
  "text-field"
4023
4020
  ],
4021
+ "appearance": true,
4024
4022
  "sdk-support": {
4025
4023
  "basic functionality": {
4026
4024
  "js": "0.10.0",
@@ -4152,6 +4150,7 @@
4152
4150
  "!": "text-radial-offset"
4153
4151
  }
4154
4152
  ],
4153
+ "appearance": true,
4155
4154
  "sdk-support": {
4156
4155
  "basic functionality": {
4157
4156
  "js": "0.10.0",
@@ -8728,6 +8727,11 @@
8728
8727
  "js": "3.0.0",
8729
8728
  "android": "11.0.0",
8730
8729
  "ios": "11.0.0"
8730
+ },
8731
+ "data-driven styling": {
8732
+ "js": "3.17.0",
8733
+ "android": "11.17.0",
8734
+ "ios": "11.17.0"
8731
8735
  }
8732
8736
  },
8733
8737
  "expression": {
@@ -8737,7 +8741,7 @@
8737
8741
  "measure-light"
8738
8742
  ]
8739
8743
  },
8740
- "property-type": "data-constant"
8744
+ "property-type": "data-driven"
8741
8745
  },
8742
8746
  "line-border-width": {
8743
8747
  "type": "number",
@@ -10722,7 +10726,8 @@
10722
10726
  "expression": {
10723
10727
  "interpolated": true,
10724
10728
  "parameters": [
10725
- "zoom"
10729
+ "zoom",
10730
+ "measure-light"
10726
10731
  ]
10727
10732
  },
10728
10733
  "property-type": "data-constant"
package/types.ts CHANGED
@@ -429,9 +429,6 @@ export type VectorSourceSpecification = {
429
429
  "url"?: string,
430
430
  "tiles"?: Array<string>,
431
431
  "bounds"?: [number, number, number, number],
432
- /**
433
- * @experimental This property is experimental and subject to change in future versions.
434
- */
435
432
  "extra_bounds"?: Array<[number, number, number, number]>,
436
433
  "scheme"?: "xyz" | "tms",
437
434
  "minzoom"?: number,
@@ -447,9 +444,6 @@ export type RasterSourceSpecification = {
447
444
  "url"?: string,
448
445
  "tiles"?: Array<string>,
449
446
  "bounds"?: [number, number, number, number],
450
- /**
451
- * @experimental This property is experimental and subject to change in future versions.
452
- */
453
447
  "extra_bounds"?: Array<[number, number, number, number]>,
454
448
  "minzoom"?: number,
455
449
  "maxzoom"?: number,
@@ -465,9 +459,6 @@ export type RasterDEMSourceSpecification = {
465
459
  "url"?: string,
466
460
  "tiles"?: Array<string>,
467
461
  "bounds"?: [number, number, number, number],
468
- /**
469
- * @experimental This property is experimental and subject to change in future versions.
470
- */
471
462
  "extra_bounds"?: Array<[number, number, number, number]>,
472
463
  "minzoom"?: number,
473
464
  "maxzoom"?: number,
@@ -486,9 +477,6 @@ export type RasterArraySourceSpecification = {
486
477
  "url"?: string,
487
478
  "tiles"?: Array<string>,
488
479
  "bounds"?: [number, number, number, number],
489
- /**
490
- * @experimental This property is experimental and subject to change in future versions.
491
- */
492
480
  "extra_bounds"?: Array<[number, number, number, number]>,
493
481
  "minzoom"?: number,
494
482
  "maxzoom"?: number,
@@ -754,7 +742,7 @@ export type LineLayerSpecification = {
754
742
  "line-trim-color"?: PropertyValueSpecification<ColorSpecification>,
755
743
  "line-trim-color-transition"?: TransitionSpecification,
756
744
  "line-trim-color-use-theme"?: PropertyValueSpecification<string>,
757
- "line-emissive-strength"?: PropertyValueSpecification<number>,
745
+ "line-emissive-strength"?: DataDrivenPropertyValueSpecification<number>,
758
746
  "line-emissive-strength-transition"?: TransitionSpecification,
759
747
  "line-border-width"?: DataDrivenPropertyValueSpecification<number>,
760
748
  "line-border-width-transition"?: TransitionSpecification,