@mapbox/mapbox-gl-style-spec 14.29.0-rc.1 → 14.30.0-alpha.742b92e7a62

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
@@ -1624,6 +1624,15 @@
1624
1624
  }
1625
1625
  }
1626
1626
  },
1627
+ "placement-group": {
1628
+ doc: "Marks a placement priority group relative to other layers, going from lower to higher priority. Symbols from groups with higher priorities will be placed first",
1629
+ "sdk-support": {
1630
+ "basic functionality": {
1631
+ }
1632
+ },
1633
+ "private": true,
1634
+ experimental: true
1635
+ },
1627
1636
  clip: {
1628
1637
  doc: "Layer that removes 3D content from map.",
1629
1638
  "sdk-support": {
@@ -1644,7 +1653,7 @@
1644
1653
  },
1645
1654
  source: {
1646
1655
  type: "string",
1647
- doc: "Name of a source description to be used for this layer. Required for all layer types except `background` and `slot`."
1656
+ doc: "Name of a source description to be used for this layer. Required for all layer types except `background`, `slot`, and `placement-group`."
1648
1657
  },
1649
1658
  "source-layer": {
1650
1659
  type: "string",
@@ -8277,6 +8286,29 @@
8277
8286
  ]
8278
8287
  },
8279
8288
  "property-type": "data-constant"
8289
+ },
8290
+ "line-cutout-depth": {
8291
+ type: "number",
8292
+ "default": 0,
8293
+ minimum: 0,
8294
+ units: "meters",
8295
+ doc: "Depth offset along the camera, in meters. When set to a non-zero value, applied cutout opacity is 0.",
8296
+ experimental: true,
8297
+ "private": true,
8298
+ transition: true,
8299
+ "sdk-support": {
8300
+ "basic functionality": {
8301
+ android: "11.29.0",
8302
+ ios: "11.29.0"
8303
+ }
8304
+ },
8305
+ expression: {
8306
+ interpolated: true,
8307
+ parameters: [
8308
+ "zoom"
8309
+ ]
8310
+ },
8311
+ "property-type": "data-constant"
8280
8312
  }
8281
8313
  };
8282
8314
  var paint_circle = {
@@ -9497,6 +9529,60 @@
9497
9529
  ]
9498
9530
  },
9499
9531
  "property-type": "data-driven"
9532
+ },
9533
+ "placement-priority": {
9534
+ type: "number",
9535
+ doc: "In-group placement priority. Higher values are placed first within the symbol's placement group.",
9536
+ "default": 0,
9537
+ minimum: 0,
9538
+ transition: false,
9539
+ appearance: true,
9540
+ expression: {
9541
+ interpolated: true,
9542
+ parameters: [
9543
+ "zoom",
9544
+ "pitch",
9545
+ "feature",
9546
+ "feature-state",
9547
+ "measure-light",
9548
+ "distance-from-center"
9549
+ ]
9550
+ },
9551
+ "property-type": "data-driven",
9552
+ "sdk-support": {
9553
+ "basic functionality": {
9554
+ },
9555
+ "data-driven styling": {
9556
+ }
9557
+ },
9558
+ "private": true,
9559
+ experimental: true
9560
+ },
9561
+ "placement-group": {
9562
+ type: "string",
9563
+ doc: "Assigns this symbol layer to the specified placement-group layer, placing its symbols as if they were drawn within that group. When unset, the layer's symbols use an implicitly created placement group located at the same position as the symbol layer.",
9564
+ transition: false,
9565
+ appearance: true,
9566
+ expression: {
9567
+ interpolated: false,
9568
+ parameters: [
9569
+ "zoom",
9570
+ "pitch",
9571
+ "feature",
9572
+ "feature-state",
9573
+ "measure-light",
9574
+ "distance-from-center"
9575
+ ]
9576
+ },
9577
+ "property-type": "data-driven",
9578
+ "sdk-support": {
9579
+ "basic functionality": {
9580
+ },
9581
+ "data-driven styling": {
9582
+ }
9583
+ },
9584
+ "private": true,
9585
+ experimental: true
9500
9586
  }
9501
9587
  };
9502
9588
  var paint_raster = {
@@ -9635,7 +9721,9 @@
9635
9721
  experimental: true,
9636
9722
  "sdk-support": {
9637
9723
  "basic functionality": {
9638
- js: "3.29.0"
9724
+ js: "3.29.0",
9725
+ android: "11.30.0",
9726
+ ios: "11.30.0"
9639
9727
  }
9640
9728
  }
9641
9729
  },
@@ -14559,14 +14647,31 @@
14559
14647
  }
14560
14648
  return sum;
14561
14649
  }
14650
+ function isCollinear(ring) {
14651
+ const len = ring.length;
14652
+ if (len < 3) return true;
14653
+ const p0 = ring[0];
14654
+ let dx = 0, dy = 0, i = 1;
14655
+ for (; i < len; i++) {
14656
+ dx = ring[i].x - p0.x;
14657
+ dy = ring[i].y - p0.y;
14658
+ if (dx !== 0 || dy !== 0) break;
14659
+ }
14660
+ if (i === len) return true;
14661
+ for (; i < len; i++) {
14662
+ const px = ring[i].x - p0.x;
14663
+ const py = ring[i].y - p0.y;
14664
+ if (dx * py - dy * px !== 0) return false;
14665
+ }
14666
+ return true;
14667
+ }
14562
14668
  function classifyRings(rings, maxRings) {
14563
14669
  const len = rings.length;
14564
- if (len <= 1) return [rings];
14565
14670
  const polygons = [];
14566
14671
  let polygon, ccw;
14567
14672
  for (let i = 0; i < len; i++) {
14568
14673
  const area = calculateSignedArea(rings[i]);
14569
- if (area === 0) continue;
14674
+ if (area === 0 && isCollinear(rings[i])) continue;
14570
14675
  rings[i].area = Math.abs(area);
14571
14676
  if (ccw === void 0) ccw = area < 0;
14572
14677
  if (ccw === area < 0) {
@@ -20312,7 +20417,7 @@ Use an identity property function instead: ${example}.`
20312
20417
  } else {
20313
20418
  type = unbundle(parent.type);
20314
20419
  }
20315
- } else if (!(type === "background" || type === "sky" || type === "slot")) {
20420
+ } else if (!(type === "background" || type === "sky" || type === "slot" || type === "placement-group")) {
20316
20421
  if (!layer.source) {
20317
20422
  errors.push(new ValidationError(key, layer, 'missing required property "source"'));
20318
20423
  } else if (!isString(layer.source)) {
@@ -20696,7 +20801,7 @@ Use an identity property function instead: ${example}.`
20696
20801
  const useThemeMatch = propertyKey.match(USE_THEME_KEY_RE);
20697
20802
  if (useThemeMatch && lightPropertySpec[useThemeMatch[1]]) {
20698
20803
  errors = errors.concat(validate({
20699
- key: key2,
20804
+ key: propertyKey,
20700
20805
  value: properties[propertyKey],
20701
20806
  valueSpec: { type: "string" },
20702
20807
  style,
@@ -20704,8 +20809,8 @@ Use an identity property function instead: ${example}.`
20704
20809
  }));
20705
20810
  } else if (transitionMatch && lightPropertySpec[transitionMatch[1]] && lightPropertySpec[transitionMatch[1]].transition) {
20706
20811
  errors = errors.concat(validate({
20707
- key: key2,
20708
- value: light[key2],
20812
+ key: propertyKey,
20813
+ value: properties[propertyKey],
20709
20814
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
20710
20815
  valueSpec: styleSpec.transition,
20711
20816
  style,
@@ -21197,7 +21302,8 @@ Use an identity property function instead: ${example}.`
21197
21302
  const MAPBOX_SPRITE_URL_RE = /^mapbox:\/\/sprites\/([^/]*)\/([^/]*)\/?([^/]*)?$/;
21198
21303
  const VISIBILITY_RE = /^(public|private)$/;
21199
21304
  const SUPPORTED_SPEC_VERSION = 8;
21200
- const MAX_SOURCES_IN_STYLE = 15;
21305
+ const MAX_SOURCES_IN_STYLE = 64;
21306
+ const MAX_TILESETS_IN_SOURCE = 15;
21201
21307
  function isValid(value, regex) {
21202
21308
  if (!value || !isString(value)) return true;
21203
21309
  return !!value.match(regex);
@@ -21234,10 +21340,20 @@ Use an identity property function instead: ${example}.`
21234
21340
  function getMaxSourcesErrors(sourcesCount) {
21235
21341
  const errors = [];
21236
21342
  if (sourcesCount > MAX_SOURCES_IN_STYLE) {
21237
- errors.push(new ValidationError("sources", null, `Styles must contain ${MAX_SOURCES_IN_STYLE} or fewer sources`));
21343
+ errors.push(new ValidationError("sources", null, `Styles must contain ${MAX_SOURCES_IN_STYLE} or fewer tilesets`));
21238
21344
  }
21239
21345
  return errors;
21240
21346
  }
21347
+ function getMaxTilesetsErrors(sources) {
21348
+ const errors = [];
21349
+ Object.keys(sources).forEach((s, i) => {
21350
+ const source = sources[s];
21351
+ if (getSourceCount(source) > MAX_TILESETS_IN_SOURCE) {
21352
+ errors.push(new ValidationError(`sources[${i}].url`, source.url, `Sources must contain ${MAX_TILESETS_IN_SOURCE} or fewer tilesets`));
21353
+ }
21354
+ });
21355
+ return errors;
21356
+ }
21241
21357
  function getSourcesErrors(sources) {
21242
21358
  const errors = [];
21243
21359
  let sourcesCount = 0;
@@ -21318,6 +21434,7 @@ Use an identity property function instead: ${example}.`
21318
21434
  const sourcesErrors = getSourcesErrors(s.sources);
21319
21435
  sourcesCount += sourcesErrors.sourcesCount;
21320
21436
  errors = errors.concat(sourcesErrors.errors);
21437
+ errors = errors.concat(getMaxTilesetsErrors(s.sources));
21321
21438
  }
21322
21439
  if (s.imports) {
21323
21440
  const importsErrors = getImportErrors(s.imports);