@mapbox/mapbox-gl-style-spec 13.26.0 → 13.27.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.
@@ -7,7 +7,6 @@ import type {Expression, SerializedExpression} from '../expression.js';
7
7
  import type ParsingContext from '../parsing_context.js';
8
8
  import type EvaluationContext from '../evaluation_context.js';
9
9
  import type {GeoJSON, GeoJSONPolygon, GeoJSONMultiPolygon} from '@mapbox/geojson-types';
10
- import Point from '@mapbox/point-geometry';
11
10
  import type {CanonicalTileID} from '../../../source/tile_id.js';
12
11
 
13
12
  type GeoJSONPolygons =| GeoJSONPolygon | GeoJSONMultiPolygon;
@@ -16,7 +15,7 @@ type GeoJSONPolygons =| GeoJSONPolygon | GeoJSONMultiPolygon;
16
15
  type BBox = [number, number, number, number];
17
16
  const EXTENT = 8192;
18
17
 
19
- function updateBBox(bbox: BBox, coord: Point) {
18
+ function updateBBox(bbox: BBox, coord: [number, number]) {
20
19
  bbox[0] = Math.min(bbox[0], coord[0]);
21
20
  bbox[1] = Math.min(bbox[1], coord[1]);
22
21
  bbox[2] = Math.max(bbox[2], coord[0]);
@@ -30,7 +30,7 @@ import type {CanonicalTileID} from '../../source/tile_id.js';
30
30
  import type {FeatureDistanceData} from '../feature_filter/index.js';
31
31
 
32
32
  export type Feature = {
33
- +type: 1 | 2 | 3 | 'Unknown' | 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon',
33
+ +type: 1 | 2 | 3 | 'Unknown' | 'Point' | 'LineString' | 'Polygon',
34
34
  +id?: number | null,
35
35
  +properties: {[_: string]: any},
36
36
  +patterns?: {[_: string]: {"min": string, "mid": string, "max": string}},
@@ -51,5 +51,5 @@ var feature = {
51
51
  };
52
52
 
53
53
  // will return a boolean based on whether the feature matched the filter
54
- return testFilter({zoom: 0}, feature);
54
+ return testFilter.filter({zoom: 0}, feature);
55
55
  ```
@@ -0,0 +1,43 @@
1
+ // @flow strict
2
+
3
+ type GeoJSONPosition = [number, number] | [number, number, number];
4
+ type Geometry<T, C> = { type: T, coordinates: C }
5
+
6
+ declare module "@mapbox/geojson-types" {
7
+ declare export type GeoJSONPoint = Geometry<'Point', GeoJSONPosition>;
8
+ declare export type GeoJSONMultiPoint = Geometry<'MultiPoint', Array<GeoJSONPosition>>;
9
+
10
+ declare export type GeoJSONLineString = Geometry<'LineString', Array<GeoJSONPosition>>;
11
+ declare export type GeoJSONMultiLineString = Geometry<'MultiLineString', Array<Array<GeoJSONPosition>>>;
12
+
13
+ declare export type GeoJSONPolygon = Geometry<'Polygon', Array<Array<GeoJSONPosition>>>;
14
+ declare export type GeoJSONMultiPolygon = Geometry<'MultiPolygon', Array<Array<Array<GeoJSONPosition>>>>;
15
+
16
+ declare export type GeoJSONGeometry =
17
+ | GeoJSONPoint
18
+ | GeoJSONMultiPoint
19
+ | GeoJSONLineString
20
+ | GeoJSONMultiLineString
21
+ | GeoJSONPolygon
22
+ | GeoJSONMultiPolygon
23
+ | GeoJSONGeometryCollection;
24
+
25
+ declare export type GeoJSONGeometryCollection = {
26
+ type: 'GeometryCollection',
27
+ geometries: Array<GeoJSONGeometry>
28
+ };
29
+
30
+ declare export type GeoJSONFeature = {
31
+ type: 'Feature',
32
+ geometry: ?GeoJSONGeometry,
33
+ properties: ?{},
34
+ id?: number | string
35
+ };
36
+
37
+ declare export type GeoJSONFeatureCollection = {
38
+ type: 'FeatureCollection',
39
+ features: Array<GeoJSONFeature>
40
+ };
41
+
42
+ declare export type GeoJSON = GeoJSONGeometry | GeoJSONFeature | GeoJSONFeatureCollection;
43
+ }
@@ -29,6 +29,7 @@ declare module "gl-matrix" {
29
29
  normalize<T: Vec3>(T, Vec3): T,
30
30
  add<T: Vec3>(T, Vec3, Vec3): T,
31
31
  sub<T: Vec3>(T, Vec3, Vec3): T,
32
+ set<T: Vec3>(T, number, number, number): T,
32
33
  subtract<T: Vec3>(T, Vec3, Vec3): T,
33
34
  cross<T: Vec3>(T, Vec3, Vec3): T,
34
35
  negate<T: Vec3>(T, Vec3): T,
@@ -52,7 +53,8 @@ declare module "gl-matrix" {
52
53
  declare var vec4: {
53
54
  scale<T: Vec4>(T, Vec4, number): T,
54
55
  mul<T: Vec4>(T, Vec4, Vec4): T,
55
- transformMat4<T: Vec4>(T, Vec4, Mat4): T
56
+ transformMat4<T: Vec4>(T, Vec4, Mat4): T,
57
+ normalize<T: Vec4>(T, Vec4): T
56
58
  };
57
59
 
58
60
  declare var mat2: {
@@ -1,11 +1,9 @@
1
1
  // @flow strict
2
2
 
3
- import type Window from '../src/types/window';
4
-
5
3
  declare module "jsdom" {
6
4
  declare class JSDOM {
7
5
  constructor(content: string, options: Object): JSDOM;
8
- window: Window;
6
+ window: WindowProxy;
9
7
  }
10
8
  declare class VirtualConsole {
11
9
  constructor(): VirtualConsole;
@@ -1,42 +1,49 @@
1
1
  // @flow
2
- import type Pbf from 'pbf';
3
- import type Point from '@mapbox/point-geometry';
4
- import type { GeoJSONFeature } from '@mapbox/geojson-types';
5
-
6
- declare interface VectorTile {
7
- layers: {[_: string]: VectorTileLayer};
8
- }
9
-
10
- declare interface VectorTileLayer {
11
- version?: number;
12
- name: string;
13
- extent: number;
14
- length: number;
15
- feature(i: number): VectorTileFeature;
16
- }
2
+ declare module "@mapbox/vector-tile" {
3
+ import type Pbf from 'pbf';
4
+ import type Point from '@mapbox/point-geometry';
5
+ import type { GeoJSONFeature } from '@mapbox/geojson-types';
17
6
 
18
- declare interface VectorTileFeature {
19
- extent: number;
20
- type: 1 | 2 | 3;
21
- id: number;
22
- properties: {[_: string]: string | number | boolean};
7
+ declare export interface IVectorTile {
8
+ layers: {[_: string]: IVectorTileLayer};
9
+ }
10
+ declare export interface IVectorTileLayer {
11
+ version?: ?number;
12
+ name: string;
13
+ extent: number;
14
+ length: number;
15
+ feature(i: number): IVectorTileFeature;
16
+ }
17
+ declare export interface IVectorTileFeature {
18
+ extent: number;
19
+ type: 1 | 2 | 3;
20
+ id: number;
21
+ properties: {[_: string]: string | number | boolean};
23
22
 
24
- loadGeometry(): Array<Array<Point>>;
25
- toGeoJSON(x: number, y: number, z: number): GeoJSONFeature;
26
- }
23
+ loadGeometry(): Array<Array<Point>>;
24
+ toGeoJSON(x: number, y: number, z: number): GeoJSONFeature;
25
+ }
27
26
 
28
- declare module "@mapbox/vector-tile" {
29
- declare class VectorTileImpl {
27
+ declare export class VectorTile implements IVectorTile {
30
28
  constructor(pbf: Pbf): VectorTile;
29
+ layers: {[_: string]: IVectorTileLayer};
30
+ }
31
+ declare export class VectorTileLayer implements IVectorTileLayer {
32
+ version?: ?number;
33
+ name: string;
34
+ extent: number;
35
+ length: number;
36
+ feature(i: number): IVectorTileFeature;
31
37
  }
38
+ declare export class VectorTileFeature implements IVectorTileFeature {
39
+ extent: number;
40
+ type: 1 | 2 | 3;
41
+ id: number;
42
+ properties: {[_: string]: string | number | boolean};
32
43
 
33
- declare class VectorTileFeatureImpl {
34
- static types: ['Unknown', 'Point', 'LineString', 'Polygon'];
44
+ loadGeometry(): Array<Array<Point>>;
35
45
  toGeoJSON(x: number, y: number, z: number): GeoJSONFeature;
36
- }
37
46
 
38
- declare module.exports: {
39
- VectorTile: typeof VectorTileImpl;
40
- VectorTileFeature: typeof VectorTileFeatureImpl;
47
+ static types: ['Unknown', 'Point', 'LineString', 'Polygon'];
41
48
  }
42
49
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mapbox/mapbox-gl-style-spec",
3
3
  "description": "a specification for mapbox gl styles",
4
- "version": "13.26.0",
4
+ "version": "13.27.0",
5
5
  "author": "Mapbox",
6
6
  "keywords": [
7
7
  "mapbox",
package/reference/v8.json CHANGED
@@ -196,7 +196,7 @@
196
196
  },
197
197
  "promoteId": {
198
198
  "type": "promoteId",
199
- "doc": "A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."
199
+ "doc": "A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"
200
200
  },
201
201
  "volatile": {
202
202
  "type": "boolean",
@@ -887,7 +887,9 @@
887
887
  "doc": "Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.",
888
888
  "sdk-support": {
889
889
  "basic functionality": {
890
- "js": "v2.10.0"
890
+ "js": "v2.10.0",
891
+ "android": "10.7.0",
892
+ "ios": "10.7.0"
891
893
  }
892
894
  },
893
895
  "property-type": "constant"
@@ -1904,7 +1906,9 @@
1904
1906
  "macos": "0.1.0"
1905
1907
  },
1906
1908
  "data-driven styling": {
1907
- "js": "2.3.0"
1909
+ "js": "2.3.0",
1910
+ "android": "10.0.0",
1911
+ "ios": "10.0.0"
1908
1912
  }
1909
1913
  },
1910
1914
  "expression": {
@@ -2812,7 +2816,9 @@
2812
2816
  "group": "Lookup",
2813
2817
  "sdk-support": {
2814
2818
  "basic functionality": {
2815
- "js": "1.10.0"
2819
+ "js": "1.10.0",
2820
+ "android": "10.0.0",
2821
+ "ios": "10.0.0"
2816
2822
  }
2817
2823
  }
2818
2824
  },
@@ -2821,7 +2827,9 @@
2821
2827
  "group": "Lookup",
2822
2828
  "sdk-support": {
2823
2829
  "basic functionality": {
2824
- "js": "1.10.0"
2830
+ "js": "1.10.0",
2831
+ "android": "10.0.0",
2832
+ "ios": "10.0.0"
2825
2833
  }
2826
2834
  }
2827
2835
  },
@@ -3208,12 +3216,14 @@
3208
3216
  "group": "Feature data",
3209
3217
  "sdk-support": {
3210
3218
  "basic functionality": {
3211
- "js": "0.46.0"
3219
+ "js": "0.46.0",
3220
+ "android": "10.0.0",
3221
+ "ios": "10.0.0"
3212
3222
  }
3213
3223
  }
3214
3224
  },
3215
3225
  "geometry-type": {
3216
- "doc": "Returns the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",
3226
+ "doc": "Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.",
3217
3227
  "group": "Feature data",
3218
3228
  "sdk-support": {
3219
3229
  "basic functionality": {
@@ -3253,7 +3263,9 @@
3253
3263
  "group": "Camera",
3254
3264
  "sdk-support": {
3255
3265
  "basic functionality": {
3256
- "js": "2.6.0"
3266
+ "js": "2.6.0",
3267
+ "android": "10.9.0",
3268
+ "ios": "10.9.0"
3257
3269
  }
3258
3270
  }
3259
3271
  },
@@ -3262,7 +3274,9 @@
3262
3274
  "group": "Camera",
3263
3275
  "sdk-support": {
3264
3276
  "basic functionality": {
3265
- "js": "2.6.0"
3277
+ "js": "2.6.0",
3278
+ "android": "10.9.0",
3279
+ "ios": "10.9.0"
3266
3280
  }
3267
3281
  }
3268
3282
  },
@@ -4686,7 +4700,7 @@
4686
4700
  ]
4687
4701
  },
4688
4702
  "transition": true,
4689
- "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.",
4703
+ "doc": "Controls the intensity of shading 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.",
4690
4704
  "sdk-support": {
4691
4705
  "basic functionality": {
4692
4706
  "js": "2.10.0",
@@ -4708,7 +4722,10 @@
4708
4722
  ]
4709
4723
  },
4710
4724
  "transition": true,
4711
- "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.",
4725
+ "doc": "Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.",
4726
+ "requires": [
4727
+ "fill-extrusion-edge-radius"
4728
+ ],
4712
4729
  "sdk-support": {
4713
4730
  "basic functionality": {
4714
4731
  "js": "2.10.0",