You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the documentation (https://docs.mapbox.com/mapbox-gl-js/api/map/#map#setstyle) doesn't specify a required localFontFamily field. The documentation also states that localIdeographFontFamily has a default value, which seems to suggest that it shouldn't be a required field.
mapbox-gl-js version: 3.7.0
browser: N/A
Steps to Trigger Behavior
Create a new Node project and include mapbox-gl 3.7.0 in package.json
In a Typescript file, import mapboxgl and create a new Map object
Call setStyle() on the map object and pass it an empty object for the options param
Expected Behavior
Typescript should not show any errors.
Actual Behavior
Typescript shows the following error:
Argument of type '{}' is not assignable to parameter of type 'SetStyleOptions'.
Type '{}' is missing the following properties from type 'SetStyleOptions': localFontFamily, localIdeographFontFamily
The text was updated successfully, but these errors were encountered:
andrewfergelbotlink
changed the title
map.setStyle() options type doesn't match docs
Map.setStyle() options type doesn't match docs
Oct 30, 2024
The
Map.setStyle()
function'soptions
param has a type ofSetStyleOptions
, which is defined in src/ui/map.ts as follows:However, the documentation (https://docs.mapbox.com/mapbox-gl-js/api/map/#map#setstyle) doesn't specify a required
localFontFamily
field. The documentation also states thatlocalIdeographFontFamily
has a default value, which seems to suggest that it shouldn't be a required field.mapbox-gl-js version: 3.7.0
browser: N/A
Steps to Trigger Behavior
setStyle()
on the map object and pass it an empty object for the options paramExpected Behavior
Typescript should not show any errors.
Actual Behavior
Typescript shows the following error:
The text was updated successfully, but these errors were encountered: