@mapbox/mapbox-gl-style-spec 14.13.0-beta.1 → 14.14.0-alpha.a4a566d51

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/dist/index.cjs CHANGED
@@ -1945,6 +1945,79 @@
1945
1945
  },
1946
1946
  "property-type": "constant"
1947
1947
  },
1948
+ "building-facade": {
1949
+ type: "boolean",
1950
+ "default": false,
1951
+ doc: "Whether to render facade details on the buildings.",
1952
+ experimental: true,
1953
+ "private": true,
1954
+ "sdk-support": {
1955
+ "basic functionality": {
1956
+ },
1957
+ "data-driven styling": {
1958
+ }
1959
+ },
1960
+ expression: {
1961
+ interpolated: false,
1962
+ parameters: [
1963
+ "feature"
1964
+ ]
1965
+ },
1966
+ "property-type": "data-driven"
1967
+ },
1968
+ "building-facade-floors": {
1969
+ type: "number",
1970
+ minimum: 1,
1971
+ maximum: 200,
1972
+ "default": 3,
1973
+ doc: "Number of floors created when building-facade is enabled.",
1974
+ experimental: true,
1975
+ "property-type": "data-driven",
1976
+ "sdk-support": {
1977
+ "basic functionality": {
1978
+ },
1979
+ "data-driven styling": {
1980
+ }
1981
+ },
1982
+ expression: {
1983
+ interpolated: false,
1984
+ parameters: [
1985
+ "feature"
1986
+ ]
1987
+ },
1988
+ requires: [
1989
+ "building-facade"
1990
+ ]
1991
+ },
1992
+ "building-facade-window": {
1993
+ type: "array",
1994
+ length: 2,
1995
+ value: "number",
1996
+ minimum: 0.1,
1997
+ maximum: 1,
1998
+ "default": [
1999
+ 0.9,
2000
+ 0.9
2001
+ ],
2002
+ doc: "Given as fractions, specifies the percentage of floor area covered by windows when building-facade is enabled",
2003
+ experimental: true,
2004
+ "property-type": "data-driven",
2005
+ "sdk-support": {
2006
+ "basic functionality": {
2007
+ },
2008
+ "data-driven styling": {
2009
+ }
2010
+ },
2011
+ expression: {
2012
+ interpolated: false,
2013
+ parameters: [
2014
+ "feature"
2015
+ ]
2016
+ },
2017
+ requires: [
2018
+ "building-facade"
2019
+ ]
2020
+ },
1948
2021
  "building-roof-shape": {
1949
2022
  type: "enum",
1950
2023
  values: {
@@ -4192,6 +4265,17 @@
4192
4265
  }
4193
4266
  }
4194
4267
  },
4268
+ split: {
4269
+ doc: "Returns an array of substrings from a string, split by a delimiter parameter.",
4270
+ group: "Lookup",
4271
+ "sdk-support": {
4272
+ "basic functionality": {
4273
+ js: "3.14.0",
4274
+ android: "11.14.0",
4275
+ ios: "11.14.0"
4276
+ }
4277
+ }
4278
+ },
4195
4279
  "case": {
4196
4280
  doc: "Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",
4197
4281
  group: "Decision",
@@ -6680,7 +6764,7 @@
6680
6764
  },
6681
6765
  "property-type": "data-constant"
6682
6766
  },
6683
- "building-ambient-occlusion-wall-intensity": {
6767
+ "building-ambient-occlusion-intensity": {
6684
6768
  "property-type": "data-constant",
6685
6769
  type: "number",
6686
6770
  "default": 0,
@@ -6689,13 +6773,12 @@
6689
6773
  experimental: true,
6690
6774
  "private": true,
6691
6775
  expression: {
6692
- interpolated: true,
6776
+ interpolated: false,
6693
6777
  parameters: [
6694
- "zoom"
6695
6778
  ]
6696
6779
  },
6697
6780
  transition: true,
6698
- doc: "Controls the intensity of shading concave angles between walls and building elements, such as facades and rooftop.",
6781
+ doc: "Controls the intensity of ambinet occlusion when shading concave angles between walls and roof crevices.",
6699
6782
  "sdk-support": {
6700
6783
  "basic functionality": {
6701
6784
  }
@@ -6814,7 +6897,8 @@
6814
6897
  interpolated: true,
6815
6898
  parameters: [
6816
6899
  "feature",
6817
- "feature-state"
6900
+ "feature-state",
6901
+ "measure-light"
6818
6902
  ]
6819
6903
  },
6820
6904
  "property-type": "data-driven"
@@ -6823,7 +6907,9 @@
6823
6907
  type: "number",
6824
6908
  "default": 0,
6825
6909
  minimum: 0,
6826
- doc: "Controls the intensity of light emitted on the source features.",
6910
+ maximum: 5,
6911
+ units: "intensity",
6912
+ doc: "Controls the intensity of light emitted on the source features. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors).",
6827
6913
  experimental: true,
6828
6914
  "private": true,
6829
6915
  "sdk-support": {
@@ -6841,6 +6927,60 @@
6841
6927
  ]
6842
6928
  },
6843
6929
  "property-type": "data-driven"
6930
+ },
6931
+ "building-facade-emissive-chance": {
6932
+ type: "number",
6933
+ "default": 0.35,
6934
+ minimum: 0,
6935
+ maximum: 1,
6936
+ doc: "Given as a fraction specifies the likelihood for the facades to be emissive when building-facade is enabled. A value of 0.0 means the window will never be emissive, while a value of 1.0 means the window will always be emissive. This can be used to create variations on a building where some windows are lit and some are not.",
6937
+ experimental: true,
6938
+ "property-type": "data-constant",
6939
+ "sdk-support": {
6940
+ "basic functionality": {
6941
+ }
6942
+ },
6943
+ expression: {
6944
+ interpolated: true,
6945
+ parameters: [
6946
+ "measure-light",
6947
+ "zoom"
6948
+ ]
6949
+ }
6950
+ },
6951
+ "building-ambient-occlusion-window-intensity": {
6952
+ type: "number",
6953
+ "default": 0,
6954
+ minimum: 0,
6955
+ maximum: 1,
6956
+ doc: "Controls the intensity of ambient occlusion applied to the windows of the buildings. A value of 0.0 means no ambient occlusion is applied, while a value of 1.0 means full ambient occlusion is applied.",
6957
+ experimental: true,
6958
+ "property-type": "data-constant",
6959
+ "sdk-support": {
6960
+ "basic functionality": {
6961
+ }
6962
+ },
6963
+ expression: {
6964
+ interpolated: false,
6965
+ parameters: [
6966
+ ]
6967
+ }
6968
+ },
6969
+ "building-cutoff-fade-range": {
6970
+ type: "number",
6971
+ "default": 0,
6972
+ minimum: 0,
6973
+ maximum: 1,
6974
+ doc: "This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. Fade out is implemented by scaling down and removing buildings in the fade range in a staggered fashion. Opacity is not changed. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",
6975
+ transition: false,
6976
+ expression: {
6977
+ interpolated: false
6978
+ },
6979
+ "sdk-support": {
6980
+ "basic functionality": {
6981
+ }
6982
+ },
6983
+ "property-type": "data-constant"
6844
6984
  }
6845
6985
  };
6846
6986
  var paint_line = {
@@ -14111,305 +14251,309 @@
14111
14251
  }
14112
14252
  }
14113
14253
 
14114
- var pointGeometry;
14115
- var hasRequiredPointGeometry;
14116
-
14117
- function requirePointGeometry () {
14118
- if (hasRequiredPointGeometry) return pointGeometry;
14119
- hasRequiredPointGeometry = 1;
14120
- pointGeometry = Point;
14121
- /**
14122
- * A standalone point geometry with useful accessor, comparison, and
14123
- * modification methods.
14124
- *
14125
- * @class Point
14126
- * @param {Number} x the x-coordinate. this could be longitude or screen
14127
- * pixels, or any other sort of unit.
14128
- * @param {Number} y the y-coordinate. this could be latitude or screen
14129
- * pixels, or any other sort of unit.
14130
- * @example
14131
- * var point = new Point(-77, 38);
14132
- */
14133
- function Point(x, y) {
14134
- this.x = x;
14135
- this.y = y;
14136
- }
14137
- Point.prototype = {
14138
- /**
14139
- * Clone this point, returning a new point that can be modified
14140
- * without affecting the old one.
14141
- * @return {Point} the clone
14142
- */
14143
- clone: function () {
14144
- return new Point(this.x, this.y);
14145
- },
14146
- /**
14147
- * Add this point's x & y coordinates to another point,
14148
- * yielding a new point.
14149
- * @param {Point} p the other point
14150
- * @return {Point} output point
14151
- */
14152
- add: function (p) {
14153
- return this.clone()._add(p);
14154
- },
14155
- /**
14156
- * Subtract this point's x & y coordinates to from point,
14157
- * yielding a new point.
14158
- * @param {Point} p the other point
14159
- * @return {Point} output point
14160
- */
14161
- sub: function (p) {
14162
- return this.clone()._sub(p);
14163
- },
14164
- /**
14165
- * Multiply this point's x & y coordinates by point,
14166
- * yielding a new point.
14167
- * @param {Point} p the other point
14168
- * @return {Point} output point
14169
- */
14170
- multByPoint: function (p) {
14171
- return this.clone()._multByPoint(p);
14172
- },
14173
- /**
14174
- * Divide this point's x & y coordinates by point,
14175
- * yielding a new point.
14176
- * @param {Point} p the other point
14177
- * @return {Point} output point
14178
- */
14179
- divByPoint: function (p) {
14180
- return this.clone()._divByPoint(p);
14181
- },
14182
- /**
14183
- * Multiply this point's x & y coordinates by a factor,
14184
- * yielding a new point.
14185
- * @param {Point} k factor
14186
- * @return {Point} output point
14187
- */
14188
- mult: function (k) {
14189
- return this.clone()._mult(k);
14190
- },
14191
- /**
14192
- * Divide this point's x & y coordinates by a factor,
14193
- * yielding a new point.
14194
- * @param {Point} k factor
14195
- * @return {Point} output point
14196
- */
14197
- div: function (k) {
14198
- return this.clone()._div(k);
14199
- },
14200
- /**
14201
- * Rotate this point around the 0, 0 origin by an angle a,
14202
- * given in radians
14203
- * @param {Number} a angle to rotate around, in radians
14204
- * @return {Point} output point
14205
- */
14206
- rotate: function (a) {
14207
- return this.clone()._rotate(a);
14208
- },
14209
- /**
14210
- * Rotate this point around p point by an angle a,
14211
- * given in radians
14212
- * @param {Number} a angle to rotate around, in radians
14213
- * @param {Point} p Point to rotate around
14214
- * @return {Point} output point
14215
- */
14216
- rotateAround: function (a, p) {
14217
- return this.clone()._rotateAround(a, p);
14218
- },
14219
- /**
14220
- * Multiply this point by a 4x1 transformation matrix
14221
- * @param {Array<Number>} m transformation matrix
14222
- * @return {Point} output point
14223
- */
14224
- matMult: function (m) {
14225
- return this.clone()._matMult(m);
14226
- },
14227
- /**
14228
- * Calculate this point but as a unit vector from 0, 0, meaning
14229
- * that the distance from the resulting point to the 0, 0
14230
- * coordinate will be equal to 1 and the angle from the resulting
14231
- * point to the 0, 0 coordinate will be the same as before.
14232
- * @return {Point} unit vector point
14233
- */
14234
- unit: function () {
14235
- return this.clone()._unit();
14236
- },
14237
- /**
14238
- * Compute a perpendicular point, where the new y coordinate
14239
- * is the old x coordinate and the new x coordinate is the old y
14240
- * coordinate multiplied by -1
14241
- * @return {Point} perpendicular point
14242
- */
14243
- perp: function () {
14244
- return this.clone()._perp();
14245
- },
14246
- /**
14247
- * Return a version of this point with the x & y coordinates
14248
- * rounded to integers.
14249
- * @return {Point} rounded point
14250
- */
14251
- round: function () {
14252
- return this.clone()._round();
14253
- },
14254
- /**
14255
- * Return the magitude of this point: this is the Euclidean
14256
- * distance from the 0, 0 coordinate to this point's x and y
14257
- * coordinates.
14258
- * @return {Number} magnitude
14259
- */
14260
- mag: function () {
14261
- return Math.sqrt(this.x * this.x + this.y * this.y);
14262
- },
14263
- /**
14264
- * Judge whether this point is equal to another point, returning
14265
- * true or false.
14266
- * @param {Point} other the other point
14267
- * @return {boolean} whether the points are equal
14268
- */
14269
- equals: function (other) {
14270
- return this.x === other.x && this.y === other.y;
14271
- },
14272
- /**
14273
- * Calculate the distance from this point to another point
14274
- * @param {Point} p the other point
14275
- * @return {Number} distance
14276
- */
14277
- dist: function (p) {
14278
- return Math.sqrt(this.distSqr(p));
14279
- },
14280
- /**
14281
- * Calculate the distance from this point to another point,
14282
- * without the square root step. Useful if you're comparing
14283
- * relative distances.
14284
- * @param {Point} p the other point
14285
- * @return {Number} distance
14286
- */
14287
- distSqr: function (p) {
14288
- var dx = p.x - this.x, dy = p.y - this.y;
14289
- return dx * dx + dy * dy;
14290
- },
14291
- /**
14292
- * Get the angle from the 0, 0 coordinate to this point, in radians
14293
- * coordinates.
14294
- * @return {Number} angle
14295
- */
14296
- angle: function () {
14297
- return Math.atan2(this.y, this.x);
14298
- },
14299
- /**
14300
- * Get the angle from this point to another point, in radians
14301
- * @param {Point} b the other point
14302
- * @return {Number} angle
14303
- */
14304
- angleTo: function (b) {
14305
- return Math.atan2(this.y - b.y, this.x - b.x);
14306
- },
14307
- /**
14308
- * Get the angle between this point and another point, in radians
14309
- * @param {Point} b the other point
14310
- * @return {Number} angle
14311
- */
14312
- angleWith: function (b) {
14313
- return this.angleWithSep(b.x, b.y);
14314
- },
14315
- /*
14316
- * Find the angle of the two vectors, solving the formula for
14317
- * the cross product a x b = |a||b|sin(θ) for θ.
14318
- * @param {Number} x the x-coordinate
14319
- * @param {Number} y the y-coordinate
14320
- * @return {Number} the angle in radians
14321
- */
14322
- angleWithSep: function (x, y) {
14323
- return Math.atan2(this.x * y - this.y * x, this.x * x + this.y * y);
14324
- },
14325
- _matMult: function (m) {
14326
- var x = m[0] * this.x + m[1] * this.y, y = m[2] * this.x + m[3] * this.y;
14327
- this.x = x;
14328
- this.y = y;
14329
- return this;
14330
- },
14331
- _add: function (p) {
14332
- this.x += p.x;
14333
- this.y += p.y;
14334
- return this;
14335
- },
14336
- _sub: function (p) {
14337
- this.x -= p.x;
14338
- this.y -= p.y;
14339
- return this;
14340
- },
14341
- _mult: function (k) {
14342
- this.x *= k;
14343
- this.y *= k;
14344
- return this;
14345
- },
14346
- _div: function (k) {
14347
- this.x /= k;
14348
- this.y /= k;
14349
- return this;
14350
- },
14351
- _multByPoint: function (p) {
14352
- this.x *= p.x;
14353
- this.y *= p.y;
14354
- return this;
14355
- },
14356
- _divByPoint: function (p) {
14357
- this.x /= p.x;
14358
- this.y /= p.y;
14359
- return this;
14360
- },
14361
- _unit: function () {
14362
- this._div(this.mag());
14363
- return this;
14364
- },
14365
- _perp: function () {
14366
- var y = this.y;
14367
- this.y = this.x;
14368
- this.x = -y;
14369
- return this;
14370
- },
14371
- _rotate: function (angle) {
14372
- var cos = Math.cos(angle), sin = Math.sin(angle), x = cos * this.x - sin * this.y, y = sin * this.x + cos * this.y;
14373
- this.x = x;
14374
- this.y = y;
14375
- return this;
14376
- },
14377
- _rotateAround: function (angle, p) {
14378
- 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);
14379
- this.x = x;
14380
- this.y = y;
14381
- return this;
14382
- },
14383
- _round: function () {
14384
- this.x = Math.round(this.x);
14385
- this.y = Math.round(this.y);
14386
- return this;
14387
- }
14388
- };
14389
- /**
14390
- * Construct a point from an array if necessary, otherwise if the input
14391
- * is already a Point, or an unknown type, return it unchanged
14392
- * @param {Array<Number>|Point|*} a any kind of input value
14393
- * @return {Point} constructed point, or passed-through value.
14394
- * @example
14395
- * // this
14396
- * var point = Point.convert([0, 1]);
14397
- * // is equivalent to
14398
- * var point = new Point(0, 1);
14399
- */
14400
- Point.convert = function (a) {
14401
- if (a instanceof Point) {
14402
- return a;
14403
- }
14404
- if (Array.isArray(a)) {
14405
- return new Point(a[0], a[1]);
14406
- }
14407
- return a;
14408
- };
14409
- return pointGeometry;
14254
+ /**
14255
+ * A standalone point geometry with useful accessor, comparison, and
14256
+ * modification methods.
14257
+ *
14258
+ * @class
14259
+ * @param {number} x the x-coordinate. This could be longitude or screen pixels, or any other sort of unit.
14260
+ * @param {number} y the y-coordinate. This could be latitude or screen pixels, or any other sort of unit.
14261
+ *
14262
+ * @example
14263
+ * const point = new Point(-77, 38);
14264
+ */
14265
+ function Point(x, y) {
14266
+ this.x = x;
14267
+ this.y = y;
14410
14268
  }
14411
-
14412
- requirePointGeometry();
14269
+ Point.prototype = {
14270
+ /**
14271
+ * Clone this point, returning a new point that can be modified
14272
+ * without affecting the old one.
14273
+ * @return {Point} the clone
14274
+ */
14275
+ clone() {
14276
+ return new Point(this.x, this.y);
14277
+ },
14278
+ /**
14279
+ * Add this point's x & y coordinates to another point,
14280
+ * yielding a new point.
14281
+ * @param {Point} p the other point
14282
+ * @return {Point} output point
14283
+ */
14284
+ add(p) {
14285
+ return this.clone()._add(p);
14286
+ },
14287
+ /**
14288
+ * Subtract this point's x & y coordinates to from point,
14289
+ * yielding a new point.
14290
+ * @param {Point} p the other point
14291
+ * @return {Point} output point
14292
+ */
14293
+ sub(p) {
14294
+ return this.clone()._sub(p);
14295
+ },
14296
+ /**
14297
+ * Multiply this point's x & y coordinates by point,
14298
+ * yielding a new point.
14299
+ * @param {Point} p the other point
14300
+ * @return {Point} output point
14301
+ */
14302
+ multByPoint(p) {
14303
+ return this.clone()._multByPoint(p);
14304
+ },
14305
+ /**
14306
+ * Divide this point's x & y coordinates by point,
14307
+ * yielding a new point.
14308
+ * @param {Point} p the other point
14309
+ * @return {Point} output point
14310
+ */
14311
+ divByPoint(p) {
14312
+ return this.clone()._divByPoint(p);
14313
+ },
14314
+ /**
14315
+ * Multiply this point's x & y coordinates by a factor,
14316
+ * yielding a new point.
14317
+ * @param {number} k factor
14318
+ * @return {Point} output point
14319
+ */
14320
+ mult(k) {
14321
+ return this.clone()._mult(k);
14322
+ },
14323
+ /**
14324
+ * Divide this point's x & y coordinates by a factor,
14325
+ * yielding a new point.
14326
+ * @param {number} k factor
14327
+ * @return {Point} output point
14328
+ */
14329
+ div(k) {
14330
+ return this.clone()._div(k);
14331
+ },
14332
+ /**
14333
+ * Rotate this point around the 0, 0 origin by an angle a,
14334
+ * given in radians
14335
+ * @param {number} a angle to rotate around, in radians
14336
+ * @return {Point} output point
14337
+ */
14338
+ rotate(a) {
14339
+ return this.clone()._rotate(a);
14340
+ },
14341
+ /**
14342
+ * Rotate this point around p point by an angle a,
14343
+ * given in radians
14344
+ * @param {number} a angle to rotate around, in radians
14345
+ * @param {Point} p Point to rotate around
14346
+ * @return {Point} output point
14347
+ */
14348
+ rotateAround(a, p) {
14349
+ return this.clone()._rotateAround(a, p);
14350
+ },
14351
+ /**
14352
+ * Multiply this point by a 4x1 transformation matrix
14353
+ * @param {[number, number, number, number]} m transformation matrix
14354
+ * @return {Point} output point
14355
+ */
14356
+ matMult(m) {
14357
+ return this.clone()._matMult(m);
14358
+ },
14359
+ /**
14360
+ * Calculate this point but as a unit vector from 0, 0, meaning
14361
+ * that the distance from the resulting point to the 0, 0
14362
+ * coordinate will be equal to 1 and the angle from the resulting
14363
+ * point to the 0, 0 coordinate will be the same as before.
14364
+ * @return {Point} unit vector point
14365
+ */
14366
+ unit() {
14367
+ return this.clone()._unit();
14368
+ },
14369
+ /**
14370
+ * Compute a perpendicular point, where the new y coordinate
14371
+ * is the old x coordinate and the new x coordinate is the old y
14372
+ * coordinate multiplied by -1
14373
+ * @return {Point} perpendicular point
14374
+ */
14375
+ perp() {
14376
+ return this.clone()._perp();
14377
+ },
14378
+ /**
14379
+ * Return a version of this point with the x & y coordinates
14380
+ * rounded to integers.
14381
+ * @return {Point} rounded point
14382
+ */
14383
+ round() {
14384
+ return this.clone()._round();
14385
+ },
14386
+ /**
14387
+ * Return the magnitude of this point: this is the Euclidean
14388
+ * distance from the 0, 0 coordinate to this point's x and y
14389
+ * coordinates.
14390
+ * @return {number} magnitude
14391
+ */
14392
+ mag() {
14393
+ return Math.sqrt(this.x * this.x + this.y * this.y);
14394
+ },
14395
+ /**
14396
+ * Judge whether this point is equal to another point, returning
14397
+ * true or false.
14398
+ * @param {Point} other the other point
14399
+ * @return {boolean} whether the points are equal
14400
+ */
14401
+ equals(other) {
14402
+ return this.x === other.x && this.y === other.y;
14403
+ },
14404
+ /**
14405
+ * Calculate the distance from this point to another point
14406
+ * @param {Point} p the other point
14407
+ * @return {number} distance
14408
+ */
14409
+ dist(p) {
14410
+ return Math.sqrt(this.distSqr(p));
14411
+ },
14412
+ /**
14413
+ * Calculate the distance from this point to another point,
14414
+ * without the square root step. Useful if you're comparing
14415
+ * relative distances.
14416
+ * @param {Point} p the other point
14417
+ * @return {number} distance
14418
+ */
14419
+ distSqr(p) {
14420
+ const dx = p.x - this.x, dy = p.y - this.y;
14421
+ return dx * dx + dy * dy;
14422
+ },
14423
+ /**
14424
+ * Get the angle from the 0, 0 coordinate to this point, in radians
14425
+ * coordinates.
14426
+ * @return {number} angle
14427
+ */
14428
+ angle() {
14429
+ return Math.atan2(this.y, this.x);
14430
+ },
14431
+ /**
14432
+ * Get the angle from this point to another point, in radians
14433
+ * @param {Point} b the other point
14434
+ * @return {number} angle
14435
+ */
14436
+ angleTo(b) {
14437
+ return Math.atan2(this.y - b.y, this.x - b.x);
14438
+ },
14439
+ /**
14440
+ * Get the angle between this point and another point, in radians
14441
+ * @param {Point} b the other point
14442
+ * @return {number} angle
14443
+ */
14444
+ angleWith(b) {
14445
+ return this.angleWithSep(b.x, b.y);
14446
+ },
14447
+ /**
14448
+ * Find the angle of the two vectors, solving the formula for
14449
+ * the cross product a x b = |a||b|sin(θ) for θ.
14450
+ * @param {number} x the x-coordinate
14451
+ * @param {number} y the y-coordinate
14452
+ * @return {number} the angle in radians
14453
+ */
14454
+ angleWithSep(x, y) {
14455
+ return Math.atan2(this.x * y - this.y * x, this.x * x + this.y * y);
14456
+ },
14457
+ /** @param {[number, number, number, number]} m */
14458
+ _matMult(m) {
14459
+ const x = m[0] * this.x + m[1] * this.y, y = m[2] * this.x + m[3] * this.y;
14460
+ this.x = x;
14461
+ this.y = y;
14462
+ return this;
14463
+ },
14464
+ /** @param {Point} p */
14465
+ _add(p) {
14466
+ this.x += p.x;
14467
+ this.y += p.y;
14468
+ return this;
14469
+ },
14470
+ /** @param {Point} p */
14471
+ _sub(p) {
14472
+ this.x -= p.x;
14473
+ this.y -= p.y;
14474
+ return this;
14475
+ },
14476
+ /** @param {number} k */
14477
+ _mult(k) {
14478
+ this.x *= k;
14479
+ this.y *= k;
14480
+ return this;
14481
+ },
14482
+ /** @param {number} k */
14483
+ _div(k) {
14484
+ this.x /= k;
14485
+ this.y /= k;
14486
+ return this;
14487
+ },
14488
+ /** @param {Point} p */
14489
+ _multByPoint(p) {
14490
+ this.x *= p.x;
14491
+ this.y *= p.y;
14492
+ return this;
14493
+ },
14494
+ /** @param {Point} p */
14495
+ _divByPoint(p) {
14496
+ this.x /= p.x;
14497
+ this.y /= p.y;
14498
+ return this;
14499
+ },
14500
+ _unit() {
14501
+ this._div(this.mag());
14502
+ return this;
14503
+ },
14504
+ _perp() {
14505
+ const y = this.y;
14506
+ this.y = this.x;
14507
+ this.x = -y;
14508
+ return this;
14509
+ },
14510
+ /** @param {number} angle */
14511
+ _rotate(angle) {
14512
+ const cos = Math.cos(angle), sin = Math.sin(angle), x = cos * this.x - sin * this.y, y = sin * this.x + cos * this.y;
14513
+ this.x = x;
14514
+ this.y = y;
14515
+ return this;
14516
+ },
14517
+ /**
14518
+ * @param {number} angle
14519
+ * @param {Point} p
14520
+ */
14521
+ _rotateAround(angle, p) {
14522
+ const 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);
14523
+ this.x = x;
14524
+ this.y = y;
14525
+ return this;
14526
+ },
14527
+ _round() {
14528
+ this.x = Math.round(this.x);
14529
+ this.y = Math.round(this.y);
14530
+ return this;
14531
+ },
14532
+ constructor: Point
14533
+ };
14534
+ /**
14535
+ * Construct a point from an array if necessary, otherwise if the input
14536
+ * is already a Point, return it unchanged.
14537
+ * @param {Point | [number, number] | {x: number, y: number}} p input value
14538
+ * @return {Point} constructed point.
14539
+ * @example
14540
+ * // this
14541
+ * var point = Point.convert([0, 1]);
14542
+ * // is equivalent to
14543
+ * var point = new Point(0, 1);
14544
+ */
14545
+ Point.convert = function (p) {
14546
+ if (p instanceof Point) {
14547
+ return p;
14548
+ }
14549
+ if (Array.isArray(p)) {
14550
+ return new Point(+p[0], +p[1]);
14551
+ }
14552
+ if (p.x !== undefined && p.y !== undefined) {
14553
+ return new Point(+p.x, +p.y);
14554
+ }
14555
+ throw new Error('Expected [x, y] or {x, y} point format');
14556
+ };
14413
14557
 
14414
14558
  function calculateSignedArea(ring) {
14415
14559
  let sum = 0;
@@ -17365,6 +17509,43 @@
17365
17509
  }
17366
17510
  }
17367
17511
 
17512
+ class Split {
17513
+ constructor(str, delimiter) {
17514
+ this.type = array$1(StringType);
17515
+ this.str = str;
17516
+ this.delimiter = delimiter;
17517
+ }
17518
+ static parse(args, context) {
17519
+ if (args.length !== 3) {
17520
+ return context.error(`Expected 2 arguments, but found ${ args.length - 1 } instead.`);
17521
+ }
17522
+ const str = context.parse(args[1], 1, StringType);
17523
+ const delimiter = context.parse(args[2], 2, StringType);
17524
+ if (!str || !delimiter)
17525
+ return;
17526
+ return new Split(str, delimiter);
17527
+ }
17528
+ evaluate(ctx) {
17529
+ const str = this.str.evaluate(ctx);
17530
+ const delimiter = this.delimiter.evaluate(ctx);
17531
+ return str.split(delimiter);
17532
+ }
17533
+ eachChild(fn) {
17534
+ fn(this.str);
17535
+ fn(this.delimiter);
17536
+ }
17537
+ outputDefined() {
17538
+ return false;
17539
+ }
17540
+ serialize() {
17541
+ return [
17542
+ 'split',
17543
+ this.str.serialize(),
17544
+ this.delimiter.serialize()
17545
+ ];
17546
+ }
17547
+ }
17548
+
17368
17549
  function isComparableType(op, type) {
17369
17550
  if (op === '==' || op === '!=') {
17370
17551
  return type.kind === 'boolean' || type.kind === 'string' || type.kind === 'number' || type.kind === 'null' || type.kind === 'value';
@@ -17696,7 +17877,8 @@
17696
17877
  'var': Var,
17697
17878
  'within': Within,
17698
17879
  'distance': Distance,
17699
- 'config': Config
17880
+ 'config': Config,
17881
+ 'split': Split
17700
17882
  };
17701
17883
  function rgba(ctx, [r, g, b, a]) {
17702
17884
  r = r.evaluate(ctx);