@mapbox/mapbox-gl-style-spec 14.29.0 → 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.d.ts CHANGED
@@ -1574,6 +1574,14 @@ declare const _exports: {
1574
1574
  };
1575
1575
  };
1576
1576
  };
1577
+ "placement-group": {
1578
+ doc: string;
1579
+ "sdk-support": {
1580
+ "basic functionality": {};
1581
+ };
1582
+ private: boolean;
1583
+ experimental: boolean;
1584
+ };
1577
1585
  clip: {
1578
1586
  doc: string;
1579
1587
  "sdk-support": {
@@ -9136,6 +9144,42 @@ declare const _exports: {
9136
9144
  };
9137
9145
  "property-type": string;
9138
9146
  };
9147
+ "placement-priority": {
9148
+ type: string;
9149
+ doc: string;
9150
+ default: number;
9151
+ minimum: number;
9152
+ transition: boolean;
9153
+ appearance: boolean;
9154
+ expression: {
9155
+ interpolated: boolean;
9156
+ parameters: string[];
9157
+ };
9158
+ "property-type": string;
9159
+ "sdk-support": {
9160
+ "basic functionality": {};
9161
+ "data-driven styling": {};
9162
+ };
9163
+ private: boolean;
9164
+ experimental: boolean;
9165
+ };
9166
+ "placement-group": {
9167
+ type: string;
9168
+ doc: string;
9169
+ transition: boolean;
9170
+ appearance: boolean;
9171
+ expression: {
9172
+ interpolated: boolean;
9173
+ parameters: string[];
9174
+ };
9175
+ "property-type": string;
9176
+ "sdk-support": {
9177
+ "basic functionality": {};
9178
+ "data-driven styling": {};
9179
+ };
9180
+ private: boolean;
9181
+ experimental: boolean;
9182
+ };
9139
9183
  };
9140
9184
  paint_raster: {
9141
9185
  "raster-opacity": {
@@ -9244,6 +9288,8 @@ declare const _exports: {
9244
9288
  "sdk-support": {
9245
9289
  "basic functionality": {
9246
9290
  js: string;
9291
+ android: string;
9292
+ ios: string;
9247
9293
  };
9248
9294
  };
9249
9295
  };
@@ -11427,6 +11473,14 @@ type SymbolLayerSpecification = {
11427
11473
  "icon-color-brightness-max"?: number | ExpressionSpecification;
11428
11474
  "symbol-z-offset"?: DataDrivenPropertyValueSpecification<number>;
11429
11475
  "symbol-z-offset-transition"?: TransitionSpecification;
11476
+ /**
11477
+ * @experimental This property is experimental and subject to change in future versions.
11478
+ */
11479
+ "placement-priority"?: DataDrivenPropertyValueSpecification<number>;
11480
+ /**
11481
+ * @experimental This property is experimental and subject to change in future versions.
11482
+ */
11483
+ "placement-group"?: DataDrivenPropertyValueSpecification<string>;
11430
11484
  };
11431
11485
  "appearances"?: Array<AppearanceSpecification>;
11432
11486
  };
@@ -12012,6 +12066,20 @@ type SlotLayerSpecification = {
12012
12066
  "layout"?: never;
12013
12067
  "paint"?: never;
12014
12068
  };
12069
+ type PlacementGroupLayerSpecification = {
12070
+ "id": string;
12071
+ "type": "placement-group";
12072
+ "metadata"?: unknown;
12073
+ "source"?: never;
12074
+ "source-layer"?: never;
12075
+ "slot"?: string;
12076
+ "minzoom"?: never;
12077
+ "maxzoom"?: never;
12078
+ "filter"?: never;
12079
+ "appearances"?: Array<AppearanceSpecification>;
12080
+ "layout"?: never;
12081
+ "paint"?: never;
12082
+ };
12015
12083
  type ClipLayerSpecification = {
12016
12084
  "id": string;
12017
12085
  "type": "clip";
@@ -12034,7 +12102,7 @@ type ClipLayerSpecification = {
12034
12102
  * @deprecated Use `ClipLayerSpecification['layout']` instead.
12035
12103
  */
12036
12104
  type ClipLayout = ClipLayerSpecification['layout'];
12037
- type LayerSpecification = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | BuildingLayerSpecification | RasterLayerSpecification | RasterParticleLayerSpecification | HillshadeLayerSpecification | ModelLayerSpecification | BackgroundLayerSpecification | SkyLayerSpecification | SlotLayerSpecification | ClipLayerSpecification;
12105
+ type LayerSpecification = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | BuildingLayerSpecification | RasterLayerSpecification | RasterParticleLayerSpecification | HillshadeLayerSpecification | ModelLayerSpecification | BackgroundLayerSpecification | SkyLayerSpecification | SlotLayerSpecification | PlacementGroupLayerSpecification | ClipLayerSpecification;
12038
12106
  type LayoutSpecification = UnionToIntersection<NonNullable<LayerSpecification['layout']>>;
12039
12107
  type PaintSpecification = UnionToIntersection<NonNullable<LayerSpecification['paint']>>;
12040
12108
  type LayerBaseSpecification = Pick<LayerSpecification, "slot" | "minzoom" | "maxzoom" | "filter" | "appearances">;
@@ -12103,6 +12171,10 @@ type SkyLayer = SkyLayerSpecification;
12103
12171
  * @deprecated Use `SlotLayerSpecification` instead.
12104
12172
  */
12105
12173
  type SlotLayer = SlotLayerSpecification;
12174
+ /**
12175
+ * @deprecated Use `PlacementGroupLayerSpecification` instead.
12176
+ */
12177
+ type PlacementGroupLayer = PlacementGroupLayerSpecification;
12106
12178
  /**
12107
12179
  * @deprecated Use `ClipLayerSpecification` instead.
12108
12180
  */
@@ -12987,4 +13059,4 @@ declare const visit: {
12987
13059
  };
12988
13060
 
12989
13061
  export { Color, ParsingError$1 as ParsingError, ValidationError$1 as ValidationError, export_default as composite, convertFilter, derefLayers, diffStyles as diff, expression, createFilter as featureFilter, format, styleFunction as function, _default as latest, export_default$1 as migrate, _exports as v8, validateStyle as validate, validateMapboxApiSupported, visit };
12990
- export type { AmbientLightSpecification, AnyLayer, AnyLayout, AnyPaint, AnySourceData, AppearanceSpecification, ArrayPropertySpecification, BackgroundLayer, BackgroundLayerSpecification, BackgroundLayout, BackgroundPaint, BooleanPropertySpecification, BuildingLayer, BuildingLayerSpecification, BuildingLayout, BuildingPaint, CameraFunctionSpecification, CameraSpecification, CircleLayer, CircleLayerSpecification, CircleLayout, CirclePaint, ClipLayer, ClipLayerSpecification, ClipLayout, ColorPropertySpecification, ColorSpecification, ColorThemeSpecification, CompositeFunctionSpecification, ConfigSpecification, DataDrivenPropertyValueSpecification, DirectionalLightSpecification, EnumPropertySpecification, Expression$1 as Expression, ExpressionSpecification, FeaturesetSpecification, FeaturesetsSpecification, FillExtrusionLayer, FillExtrusionLayerSpecification, FillExtrusionLayout, FillExtrusionPaint, FillLayer, FillLayerSpecification, FillLayout, FillPaint, FilterSpecification, FlatLightSpecification, FogSpecification, FormattedPropertySpecification, FormattedSpecification, FunctionSpecification, GeoJSONSourceSpecification, HeatmapLayer, HeatmapLayerSpecification, HeatmapLayout, HeatmapPaint, HillshadeLayer, HillshadeLayerSpecification, HillshadeLayout, HillshadePaint, IconsetSpecification, IconsetsSpecification, ImageSourceSpecification, ImportSpecification, IndoorSourceSpecification, IndoorSpecification, Layer, LayerBaseSpecification, LayerSpecification, LayoutSpecification, LightSpecification, LightsSpecification, LineLayer, LineLayerSpecification, LineLayout, LinePaint, ModelLayer, ModelLayerSpecification, ModelLayout, ModelLightOverridesSpecification, ModelMaterialOverrideSpecification, ModelMaterialOverridesSpecification, ModelNodeOverrideSpecification, ModelNodeOverridesSpecification, ModelPaint, ModelSourceModelSpecification, ModelSourceModelsSpecification, ModelSourceSpecification, ModelSpecification, ModelsSpecification, NumberPropertySpecification, OptionSpecification, PaintSpecification, Projection, ProjectionSpecification, PromoteIdSpecification, PropertyExpressionSpecification, PropertyFunctionStop, PropertyValueSpecification, RainSpecification, RasterArraySourceSpecification, RasterDEMSourceSpecification, RasterLayer, RasterLayerSpecification, RasterLayout, RasterPaint, RasterParticleLayer, RasterParticleLayerSpecification, RasterParticleLayout, RasterParticlePaint, RasterSourceSpecification, ResolvedImagePropertySpecification, ResolvedImageSpecification, SchemaSpecification, SelectorPropertySpecification, SelectorSpecification, SkyLayer, SkyLayerSpecification, SkyLayout, SkyPaint, SlotLayer, SlotLayerSpecification, SnowSpecification, SourceFunctionSpecification, SourceSpecification, Sources, SourcesSpecification, StringPropertySpecification, Style, StylePropertySpecification, StyleSpecification, SymbolLayer, SymbolLayerSpecification, SymbolLayout, SymbolPaint, TerrainSpecification, TerrainSpecificationUpdate, Transition, TransitionSpecification, VectorSourceSpecification, VideoSourceSpecification, ZoomAndPropertyFunctionStop };
13062
+ export type { AmbientLightSpecification, AnyLayer, AnyLayout, AnyPaint, AnySourceData, AppearanceSpecification, ArrayPropertySpecification, BackgroundLayer, BackgroundLayerSpecification, BackgroundLayout, BackgroundPaint, BooleanPropertySpecification, BuildingLayer, BuildingLayerSpecification, BuildingLayout, BuildingPaint, CameraFunctionSpecification, CameraSpecification, CircleLayer, CircleLayerSpecification, CircleLayout, CirclePaint, ClipLayer, ClipLayerSpecification, ClipLayout, ColorPropertySpecification, ColorSpecification, ColorThemeSpecification, CompositeFunctionSpecification, ConfigSpecification, DataDrivenPropertyValueSpecification, DirectionalLightSpecification, EnumPropertySpecification, Expression$1 as Expression, ExpressionSpecification, FeaturesetSpecification, FeaturesetsSpecification, FillExtrusionLayer, FillExtrusionLayerSpecification, FillExtrusionLayout, FillExtrusionPaint, FillLayer, FillLayerSpecification, FillLayout, FillPaint, FilterSpecification, FlatLightSpecification, FogSpecification, FormattedPropertySpecification, FormattedSpecification, FunctionSpecification, GeoJSONSourceSpecification, HeatmapLayer, HeatmapLayerSpecification, HeatmapLayout, HeatmapPaint, HillshadeLayer, HillshadeLayerSpecification, HillshadeLayout, HillshadePaint, IconsetSpecification, IconsetsSpecification, ImageSourceSpecification, ImportSpecification, IndoorSourceSpecification, IndoorSpecification, Layer, LayerBaseSpecification, LayerSpecification, LayoutSpecification, LightSpecification, LightsSpecification, LineLayer, LineLayerSpecification, LineLayout, LinePaint, ModelLayer, ModelLayerSpecification, ModelLayout, ModelLightOverridesSpecification, ModelMaterialOverrideSpecification, ModelMaterialOverridesSpecification, ModelNodeOverrideSpecification, ModelNodeOverridesSpecification, ModelPaint, ModelSourceModelSpecification, ModelSourceModelsSpecification, ModelSourceSpecification, ModelSpecification, ModelsSpecification, NumberPropertySpecification, OptionSpecification, PaintSpecification, PlacementGroupLayer, PlacementGroupLayerSpecification, Projection, ProjectionSpecification, PromoteIdSpecification, PropertyExpressionSpecification, PropertyFunctionStop, PropertyValueSpecification, RainSpecification, RasterArraySourceSpecification, RasterDEMSourceSpecification, RasterLayer, RasterLayerSpecification, RasterLayout, RasterPaint, RasterParticleLayer, RasterParticleLayerSpecification, RasterParticleLayout, RasterParticlePaint, RasterSourceSpecification, ResolvedImagePropertySpecification, ResolvedImageSpecification, SchemaSpecification, SelectorPropertySpecification, SelectorSpecification, SkyLayer, SkyLayerSpecification, SkyLayout, SkyPaint, SlotLayer, SlotLayerSpecification, SnowSpecification, SourceFunctionSpecification, SourceSpecification, Sources, SourcesSpecification, StringPropertySpecification, Style, StylePropertySpecification, StyleSpecification, SymbolLayer, SymbolLayerSpecification, SymbolLayout, SymbolPaint, TerrainSpecification, TerrainSpecificationUpdate, Transition, TransitionSpecification, VectorSourceSpecification, VideoSourceSpecification, ZoomAndPropertyFunctionStop };
package/dist/index.es.js CHANGED
@@ -1618,6 +1618,15 @@ var layer = {
1618
1618
  }
1619
1619
  }
1620
1620
  },
1621
+ "placement-group": {
1622
+ 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",
1623
+ "sdk-support": {
1624
+ "basic functionality": {
1625
+ }
1626
+ },
1627
+ "private": true,
1628
+ experimental: true
1629
+ },
1621
1630
  clip: {
1622
1631
  doc: "Layer that removes 3D content from map.",
1623
1632
  "sdk-support": {
@@ -1638,7 +1647,7 @@ var layer = {
1638
1647
  },
1639
1648
  source: {
1640
1649
  type: "string",
1641
- doc: "Name of a source description to be used for this layer. Required for all layer types except `background` and `slot`."
1650
+ doc: "Name of a source description to be used for this layer. Required for all layer types except `background`, `slot`, and `placement-group`."
1642
1651
  },
1643
1652
  "source-layer": {
1644
1653
  type: "string",
@@ -9514,6 +9523,60 @@ var paint_symbol = {
9514
9523
  ]
9515
9524
  },
9516
9525
  "property-type": "data-driven"
9526
+ },
9527
+ "placement-priority": {
9528
+ type: "number",
9529
+ doc: "In-group placement priority. Higher values are placed first within the symbol's placement group.",
9530
+ "default": 0,
9531
+ minimum: 0,
9532
+ transition: false,
9533
+ appearance: true,
9534
+ expression: {
9535
+ interpolated: true,
9536
+ parameters: [
9537
+ "zoom",
9538
+ "pitch",
9539
+ "feature",
9540
+ "feature-state",
9541
+ "measure-light",
9542
+ "distance-from-center"
9543
+ ]
9544
+ },
9545
+ "property-type": "data-driven",
9546
+ "sdk-support": {
9547
+ "basic functionality": {
9548
+ },
9549
+ "data-driven styling": {
9550
+ }
9551
+ },
9552
+ "private": true,
9553
+ experimental: true
9554
+ },
9555
+ "placement-group": {
9556
+ type: "string",
9557
+ 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.",
9558
+ transition: false,
9559
+ appearance: true,
9560
+ expression: {
9561
+ interpolated: false,
9562
+ parameters: [
9563
+ "zoom",
9564
+ "pitch",
9565
+ "feature",
9566
+ "feature-state",
9567
+ "measure-light",
9568
+ "distance-from-center"
9569
+ ]
9570
+ },
9571
+ "property-type": "data-driven",
9572
+ "sdk-support": {
9573
+ "basic functionality": {
9574
+ },
9575
+ "data-driven styling": {
9576
+ }
9577
+ },
9578
+ "private": true,
9579
+ experimental: true
9517
9580
  }
9518
9581
  };
9519
9582
  var paint_raster = {
@@ -9652,7 +9715,9 @@ var paint_raster = {
9652
9715
  experimental: true,
9653
9716
  "sdk-support": {
9654
9717
  "basic functionality": {
9655
- js: "3.29.0"
9718
+ js: "3.29.0",
9719
+ android: "11.30.0",
9720
+ ios: "11.30.0"
9656
9721
  }
9657
9722
  }
9658
9723
  },
@@ -14576,14 +14641,31 @@ function calculateSignedArea(ring) {
14576
14641
  }
14577
14642
  return sum;
14578
14643
  }
14644
+ function isCollinear(ring) {
14645
+ const len = ring.length;
14646
+ if (len < 3) return true;
14647
+ const p0 = ring[0];
14648
+ let dx = 0, dy = 0, i = 1;
14649
+ for (; i < len; i++) {
14650
+ dx = ring[i].x - p0.x;
14651
+ dy = ring[i].y - p0.y;
14652
+ if (dx !== 0 || dy !== 0) break;
14653
+ }
14654
+ if (i === len) return true;
14655
+ for (; i < len; i++) {
14656
+ const px = ring[i].x - p0.x;
14657
+ const py = ring[i].y - p0.y;
14658
+ if (dx * py - dy * px !== 0) return false;
14659
+ }
14660
+ return true;
14661
+ }
14579
14662
  function classifyRings(rings, maxRings) {
14580
14663
  const len = rings.length;
14581
- if (len <= 1) return [rings];
14582
14664
  const polygons = [];
14583
14665
  let polygon, ccw;
14584
14666
  for (let i = 0; i < len; i++) {
14585
14667
  const area = calculateSignedArea(rings[i]);
14586
- if (area === 0) continue;
14668
+ if (area === 0 && isCollinear(rings[i])) continue;
14587
14669
  rings[i].area = Math.abs(area);
14588
14670
  if (ccw === void 0) ccw = area < 0;
14589
14671
  if (ccw === area < 0) {
@@ -20329,7 +20411,7 @@ function validateLayer(options) {
20329
20411
  } else {
20330
20412
  type = unbundle(parent.type);
20331
20413
  }
20332
- } else if (!(type === "background" || type === "sky" || type === "slot")) {
20414
+ } else if (!(type === "background" || type === "sky" || type === "slot" || type === "placement-group")) {
20333
20415
  if (!layer.source) {
20334
20416
  errors.push(new ValidationError(key, layer, 'missing required property "source"'));
20335
20417
  } else if (!isString(layer.source)) {
@@ -20713,7 +20795,7 @@ function validateLights(options) {
20713
20795
  const useThemeMatch = propertyKey.match(USE_THEME_KEY_RE);
20714
20796
  if (useThemeMatch && lightPropertySpec[useThemeMatch[1]]) {
20715
20797
  errors = errors.concat(validate({
20716
- key: key2,
20798
+ key: propertyKey,
20717
20799
  value: properties[propertyKey],
20718
20800
  valueSpec: { type: "string" },
20719
20801
  style,
@@ -20721,8 +20803,8 @@ function validateLights(options) {
20721
20803
  }));
20722
20804
  } else if (transitionMatch && lightPropertySpec[transitionMatch[1]] && lightPropertySpec[transitionMatch[1]].transition) {
20723
20805
  errors = errors.concat(validate({
20724
- key: key2,
20725
- value: light[key2],
20806
+ key: propertyKey,
20807
+ value: properties[propertyKey],
20726
20808
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
20727
20809
  valueSpec: styleSpec.transition,
20728
20810
  style,
@@ -21214,7 +21296,8 @@ const MAPBOX_GLYPH_URL_RE = /^mapbox:\/\/fonts\/([^/]*)\/{fontstack}\/{range}.pb
21214
21296
  const MAPBOX_SPRITE_URL_RE = /^mapbox:\/\/sprites\/([^/]*)\/([^/]*)\/?([^/]*)?$/;
21215
21297
  const VISIBILITY_RE = /^(public|private)$/;
21216
21298
  const SUPPORTED_SPEC_VERSION = 8;
21217
- const MAX_SOURCES_IN_STYLE = 15;
21299
+ const MAX_SOURCES_IN_STYLE = 64;
21300
+ const MAX_TILESETS_IN_SOURCE = 15;
21218
21301
  function isValid(value, regex) {
21219
21302
  if (!value || !isString(value)) return true;
21220
21303
  return !!value.match(regex);
@@ -21251,10 +21334,20 @@ function getSourceErrors(source, i) {
21251
21334
  function getMaxSourcesErrors(sourcesCount) {
21252
21335
  const errors = [];
21253
21336
  if (sourcesCount > MAX_SOURCES_IN_STYLE) {
21254
- errors.push(new ValidationError("sources", null, `Styles must contain ${MAX_SOURCES_IN_STYLE} or fewer sources`));
21337
+ errors.push(new ValidationError("sources", null, `Styles must contain ${MAX_SOURCES_IN_STYLE} or fewer tilesets`));
21255
21338
  }
21256
21339
  return errors;
21257
21340
  }
21341
+ function getMaxTilesetsErrors(sources) {
21342
+ const errors = [];
21343
+ Object.keys(sources).forEach((s, i) => {
21344
+ const source = sources[s];
21345
+ if (getSourceCount(source) > MAX_TILESETS_IN_SOURCE) {
21346
+ errors.push(new ValidationError(`sources[${i}].url`, source.url, `Sources must contain ${MAX_TILESETS_IN_SOURCE} or fewer tilesets`));
21347
+ }
21348
+ });
21349
+ return errors;
21350
+ }
21258
21351
  function getSourcesErrors(sources) {
21259
21352
  const errors = [];
21260
21353
  let sourcesCount = 0;
@@ -21335,6 +21428,7 @@ function validateMapboxApiSupported(style, styleSpec = v8) {
21335
21428
  const sourcesErrors = getSourcesErrors(s.sources);
21336
21429
  sourcesCount += sourcesErrors.sourcesCount;
21337
21430
  errors = errors.concat(sourcesErrors.errors);
21431
+ errors = errors.concat(getMaxTilesetsErrors(s.sources));
21338
21432
  }
21339
21433
  if (s.imports) {
21340
21434
  const importsErrors = getImportErrors(s.imports);