From 109c334bdffaa5b2016c50bf6aaa119ce56082ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20P=C3=A9rez=20Sampayo?= Date: Sat, 21 Jan 2023 23:46:36 +0100 Subject: [PATCH] Change fog and terrain types to match Mapbox types. (#2106) --- docs/api-reference/map.md | 6 +++--- src/mapbox/mapbox.ts | 8 ++++---- test/src/utils/mapbox-gl-mock/style.js | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/api-reference/map.md b/docs/api-reference/map.md index f091ca9ed..0db437249 100644 --- a/docs/api-reference/map.md +++ b/docs/api-reference/map.md @@ -73,10 +73,10 @@ The current cursor [type](https://developer.mozilla.org/en-US/docs/Web/CSS/curso ### Styling options -#### `fog`: [Fog](/docs/api-reference/types.md#fog) | null +#### `fog`: [Fog](/docs/api-reference/types.md#fog) The fog property of the style. Must conform to the [Fog Style Specification](https://docs.mapbox.com/mapbox-gl-js/style-spec/fog/). -If `null` is provided, removes the fog from the map. +If `undefined` is provided, removes the fog from the map. #### `light`: [Light](/docs/api-reference/types.md#light) @@ -109,7 +109,7 @@ Enable diffing when `mapStyle` changes. If `false`, force a 'full' update, remov #### `terrain`: [TerrainSpecification](/docs/api-reference/types.md#terrainspecification) Terrain property of the style. Must conform to the [Terrain Style Specification](https://docs.mapbox.com/mapbox-gl-js/style-spec/terrain/). -If `null` is provided, removes terrain from the map. +If `undefined` is provided, removes terrain from the map. ### Camera options diff --git a/src/mapbox/mapbox.ts b/src/mapbox/mapbox.ts index b937b8210..4ed449c4d 100644 --- a/src/mapbox/mapbox.ts +++ b/src/mapbox/mapbox.ts @@ -257,13 +257,13 @@ export type MapboxProps = Partial & { */ styleDiffing?: boolean; /** The fog property of the style. Must conform to the Fog Style Specification . - * If `null` is provided, removes the fog from the map. */ - fog?: Fog | null; + * If `undefined` is provided, removes the fog from the map. */ + fog?: Fog; /** Light properties of the map. */ light?: Light; /** Terrain property of the style. Must conform to the Terrain Style Specification . - * If `null` is provided, removes terrain from the map. */ - terrain?: TerrainSpecification | null; + * If `undefined` is provided, removes terrain from the map. */ + terrain?: TerrainSpecification; /** Default layers to query on pointer events */ interactiveLayerIds?: string[]; /** The projection the map should be rendered in diff --git a/test/src/utils/mapbox-gl-mock/style.js b/test/src/utils/mapbox-gl-mock/style.js index c8a876f0d..cc1f26506 100644 --- a/test/src/utils/mapbox-gl-mock/style.js +++ b/test/src/utils/mapbox-gl-mock/style.js @@ -11,8 +11,8 @@ export default class Style { this._loaded = false; this._light = null; - this._fog = null; - this._terrain = null; + this._fog = undefined; + this._terrain = undefined; this._sources = {}; this._layers = [];