@mapbox/mapbox-gl-style-spec 13.23.1-beta.1 → 13.24.0-alpha.3

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.
@@ -51,7 +51,7 @@ class EvaluationContext {
51
51
  }
52
52
 
53
53
  properties() {
54
- return this.feature && this.feature.properties || {};
54
+ return (this.feature && this.feature.properties) || {};
55
55
  }
56
56
 
57
57
  distanceFromCenter() {
@@ -286,11 +286,11 @@ export class StylePropertyFunction<T> {
286
286
  extend(this, createFunction(this._parameters, this._specification));
287
287
  }
288
288
 
289
- static deserialize(serialized: {_parameters: PropertyValueSpecification<T>, _specification: StylePropertySpecification}) {
290
- return ((new StylePropertyFunction(serialized._parameters, serialized._specification)): StylePropertyFunction<T>);
289
+ static deserialize(serialized: {_parameters: PropertyValueSpecification<T>, _specification: StylePropertySpecification}): StylePropertyFunction<T> {
290
+ return new StylePropertyFunction(serialized._parameters, serialized._specification);
291
291
  }
292
292
 
293
- static serialize(input: StylePropertyFunction<T>) {
293
+ static serialize(input: StylePropertyFunction<T>): {_parameters: PropertyValueSpecification<T>, _specification: StylePropertySpecification} {
294
294
  return {
295
295
  _parameters: input._parameters,
296
296
  _specification: input._specification
@@ -94,7 +94,7 @@ function _convertFilter(filter: FilterSpecification, expectedTypes: ExpectedType
94
94
  const children = (filter: any).slice(1).map(f => _convertFilter(f, expectedTypes));
95
95
  return children.length > 1 ? ['all'].concat(children) : [].concat(...children);
96
96
  } else if (op === 'none') {
97
- return ['!', _convertFilter(['any'].concat(filter.slice(1)), {})];
97
+ return ['!', _convertFilter(['any'].concat((filter: any).slice(1)), {})];
98
98
  } else if (op === 'in') {
99
99
  converted = convertInOp((filter[1]: any), filter.slice(2));
100
100
  } else if (op === '!in') {
@@ -0,0 +1,102 @@
1
+ // @flow
2
+ type VecType = Array<number> | Float32Array | Float64Array;
3
+
4
+ declare module "gl-matrix" {
5
+ declare type Vec2 = VecType;
6
+ declare type Vec3 = VecType;
7
+ declare type Vec4 = VecType;
8
+ declare type Quat = VecType;
9
+ declare type Mat2 = VecType;
10
+ declare type Mat3 = VecType;
11
+ declare type Mat4 = VecType;
12
+
13
+ declare var vec2: {
14
+ exactEquals(Vec2, Vec2): boolean
15
+ };
16
+
17
+ declare var vec3: {
18
+ create(): Float32Array,
19
+ fromValues(number, number, number): Float32Array,
20
+ length(Vec3): number,
21
+ len(Vec3): number,
22
+ squaredLength(Vec3): number,
23
+ dot(Vec3, Vec3): number,
24
+ equals(Vec3, Vec3): boolean,
25
+ exactEquals(Vec3, Vec3): boolean,
26
+
27
+ clone<T: Vec3>(T): T,
28
+ normalize<T: Vec3>(T, Vec3): T,
29
+ add<T: Vec3>(T, Vec3, Vec3): T,
30
+ sub<T: Vec3>(T, Vec3, Vec3): T,
31
+ subtract<T: Vec3>(T, Vec3, Vec3): T,
32
+ cross<T: Vec3>(T, Vec3, Vec3): T,
33
+ negate<T: Vec3>(T, Vec3): T,
34
+ scale<T: Vec3>(T, Vec3, number): T,
35
+ scaleAndAdd<T: Vec3>(T, Vec3, Vec3, number): T,
36
+ multiply<T: Vec3>(T, Vec3, Vec3): T,
37
+ mul<T: Vec3>(T, Vec3, Vec3): T,
38
+ div<T: Vec3>(T, Vec3, Vec3): T,
39
+ min<T: Vec3>(T, Vec3, Vec3): T,
40
+ max<T: Vec3>(T, Vec3, Vec3): T,
41
+ transformQuat<T: Vec3>(T, Vec3, Quat): T,
42
+ transformMat3<T: Vec3>(T, Vec3, Mat3): T,
43
+ transformMat4<T: Vec3>(T, Vec3, Mat4): T
44
+ };
45
+
46
+ declare var vec4: {
47
+ scale<T: Vec4>(T, Vec4, number): T,
48
+ mul<T: Vec4>(T, Vec4, Vec4): T,
49
+ transformMat4<T: Vec4>(T, Vec4, Mat4): T
50
+ };
51
+
52
+ declare var mat2: {
53
+ create(): Float32Array,
54
+ rotate<T: Mat2>(T, Mat2, number): T,
55
+ invert<T: Mat2>(T, Mat2): T,
56
+ scale<T: Mat2>(T, Mat2, Vec2): T
57
+ };
58
+
59
+ declare var mat3: {
60
+ create(): Float32Array,
61
+
62
+ fromMat4<T: Mat3>(T, Mat4): T,
63
+ fromRotation<T: Mat3>(T, number): T,
64
+ mul<T: Mat3>(T, Mat3, Mat3): T,
65
+ multiply<T: Mat3>(T, Mat3, Mat3): T,
66
+ adjoint<T: Mat3>(T, Mat3): T,
67
+ transpose<T: Mat3>(T, Mat3): T
68
+ };
69
+
70
+ declare var mat4: {
71
+ create(): Float32Array,
72
+
73
+ fromScaling<T: Mat4>(T, Vec3): T,
74
+ fromQuat<T: Mat4>(T, Quat): T,
75
+ ortho<T: Mat4>(T, number, number, number, number, number, number): T,
76
+ perspective<T: Mat4>(T, number, number, number, number): T,
77
+ identity<T: Mat4>(T): T,
78
+ scale<T: Mat4>(T, Mat4, Vec3): T,
79
+ mul<T: Mat4>(T, Mat4, Mat4): T,
80
+ multiply<T: Mat4>(T, Mat4, Mat4): T,
81
+ rotateX<T: Mat4>(T, Mat4, number): T,
82
+ rotateY<T: Mat4>(T, Mat4, number): T,
83
+ rotateZ<T: Mat4>(T, Mat4, number): T,
84
+ translate<T: Mat4>(T, Mat4, Vec3): T,
85
+ invert<T: Mat4>(T, Mat4): T,
86
+ copy<T: Mat4>(T, Mat4): T,
87
+ clone<T: Mat4>(T): T
88
+ };
89
+
90
+ declare var quat: {
91
+ create(): Float32Array,
92
+ length(Quat): number,
93
+ exactEquals(Quat, Quat): boolean,
94
+
95
+ normalize<T: Quat>(T, Quat): T,
96
+ conjugate<T: Quat>(T, Quat): T,
97
+ identity<T: Quat>(T): T,
98
+ rotateX<T: Quat>(T, Quat, number): T,
99
+ rotateY<T: Quat>(T, Quat, number): T,
100
+ rotateZ<T: Quat>(T, Quat, number): T
101
+ }
102
+ }
@@ -0,0 +1,13 @@
1
+ // @flow strict
2
+ declare module 'grid-index' {
3
+ declare class GridIndex {
4
+ constructor(extent: number, n: number, padding: number): GridIndex;
5
+ constructor(data: ArrayBuffer): GridIndex;
6
+
7
+ insert(key: number, x1: number, y1: number, x2: number, y2: number): void;
8
+ query(x1: number, y1: number, x2: number, y2: number, intersectionText?: (number, number, number, number) => boolean): Array<number>;
9
+ toArrayBuffer(): ArrayBuffer;
10
+ }
11
+
12
+ declare export default Class<GridIndex>;
13
+ }
package/flow-typed/pbf.js CHANGED
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  declare module "pbf" {
2
3
  declare type ReadFunction<T> = (tag: number, result: T, pbf: Pbf) => void;
3
4
 
@@ -21,5 +22,5 @@ declare module "pbf" {
21
22
  readBytes(): Uint8Array;
22
23
  }
23
24
 
24
- declare module.exports: typeof Pbf
25
+ declare export default Class<Pbf>;
25
26
  }
@@ -1,5 +1,6 @@
1
+ // @flow strict
1
2
  declare module "@mapbox/point-geometry" {
2
- declare type PointLike = Point | [number, number];
3
+ declare export type PointLike = Point | [number, number];
3
4
 
4
5
  declare class Point {
5
6
  x: number;
@@ -40,5 +41,6 @@ declare module "@mapbox/point-geometry" {
40
41
  _round(): Point;
41
42
  static convert(a: PointLike): Point;
42
43
  }
43
- declare module.exports: typeof Point;
44
+
45
+ declare export default Class<Point>;
44
46
  }
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  declare module "potpack" {
2
3
  declare type Bin = {
3
4
  x: number,
@@ -0,0 +1,31 @@
1
+
2
+ declare module '@mapbox/tiny-sdf' {
3
+ declare type TinySDFOptions = {
4
+ fontSize?: number;
5
+ buffer?: number;
6
+ radius?: number;
7
+ cutoff?: number;
8
+ fontFamily?: string;
9
+ fontWeight?: string;
10
+ fontStyle?: string;
11
+ };
12
+
13
+ declare type TinySDFGlyph = {
14
+ data: Uint8ClampedArray;
15
+ width: number;
16
+ height: number;
17
+ glyphWidth: number;
18
+ glyphHeight: number;
19
+ glyphTop: number;
20
+ glyphLeft: number;
21
+ glyphAdvance: number;
22
+ };
23
+
24
+ declare class TinySDF {
25
+ fontWeight: string;
26
+ constructor(options: TinySDFOptions): TinySDF;
27
+ draw(char: string): TinySDFGlyph;
28
+ }
29
+
30
+ declare export default Class<TinySDF>;
31
+ }
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import type Pbf from 'pbf';
2
3
  import type Point from '@mapbox/point-geometry';
3
4
  import type { GeoJSONFeature } from '@mapbox/geojson-types';
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.23.1-beta.1",
4
+ "version": "13.24.0-alpha.3",
5
5
  "author": "Mapbox",
6
6
  "keywords": [
7
7
  "mapbox",
package/reference/v8.json CHANGED
@@ -96,7 +96,7 @@
96
96
  },
97
97
  "projection": {
98
98
  "type": "projection",
99
- "doc": "The projection the map should be rendered in. Supported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",
99
+ "doc": "The projection the map should be rendered in. Supported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, Globe, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",
100
100
  "example": {
101
101
  "name": "albers",
102
102
  "center": [-154, 50],
@@ -3991,6 +3991,9 @@
3991
3991
  },
3992
3992
  "winkelTripel": {
3993
3993
  "doc": "A Winkel Tripel projection."
3994
+ },
3995
+ "globe": {
3996
+ "doc": "A globe projection."
3994
3997
  }
3995
3998
  },
3996
3999
  "default": "mercator",
package/style-spec.js CHANGED
@@ -57,6 +57,12 @@ export type StylePropertySpecification = {
57
57
  length?: number,
58
58
  transition: boolean,
59
59
  default?: Array<string>
60
+ } | {
61
+ type: 'resolvedImage',
62
+ 'property-type': ExpressionType,
63
+ expression?: ExpressionSpecification,
64
+ transition: boolean,
65
+ default?: string
60
66
  };
61
67
 
62
68
  import v8 from './reference/v8.json';
package/types.js CHANGED
@@ -95,7 +95,7 @@ export type FogSpecification = {|
95
95
  |}
96
96
 
97
97
  export type ProjectionSpecification = {|
98
- "name": "albers" | "equalEarth" | "equirectangular" | "lambertConformalConic" | "mercator" | "naturalEarth" | "winkelTripel",
98
+ "name": "albers" | "equalEarth" | "equirectangular" | "lambertConformalConic" | "mercator" | "naturalEarth" | "winkelTripel" | "globe",
99
99
  "center"?: [number, number],
100
100
  "parallels"?: [number, number]
101
101
  |}