Skip to content

Commit

Permalink
fix: typedef localIdeographFontFamily #3895 (#3896)
Browse files Browse the repository at this point in the history
* fix: typedef localIdeographFontFamily #3895

* fix: not optional

* fix: not optional

* fix: revert to optional

* fix: not optional

* fix: not optional

* add changelog #3896
  • Loading branch information
Kanahiro authored Mar 25, 2024
1 parent f6035db commit c0aee04
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- _...Add new stuff here..._

### 🐞 Bug fixes
- _...Add new stuff here..._
- fix type defnition on `localIdeographFontFamily` ([#3896](https://github.com/maplibre/maplibre-gl-js/pull/3896))

## 4.1.1

Expand Down
4 changes: 2 additions & 2 deletions src/render/glyph_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ type Entry = {

export class GlyphManager {
requestManager: RequestManager;
localIdeographFontFamily: string;
localIdeographFontFamily: string | false;
entries: {[stack: string]: Entry};
url: string;

// exposed as statics to enable stubbing in unit tests
static loadGlyphRange = loadGlyphRange;
static TinySDF = TinySDF;

constructor(requestManager: RequestManager, localIdeographFontFamily?: string | null) {
constructor(requestManager: RequestManager, localIdeographFontFamily?: string | false) {
this.requestManager = requestManager;
this.localIdeographFontFamily = localIdeographFontFamily;
this.entries = {};
Expand Down
2 changes: 1 addition & 1 deletion src/style/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export type StyleOptions = {
* Set to `false`, to enable font settings from the map's style for these glyph ranges.
* Forces a full update.
*/
localIdeographFontFamily?: string;
localIdeographFontFamily?: string | false;
};

/**
Expand Down
4 changes: 2 additions & 2 deletions src/ui/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export type MapOptions = {
* The purpose of this option is to avoid bandwidth-intensive glyph server requests. (See [Use locally generated ideographs](https://maplibre.org/maplibre-gl-js/docs/examples/local-ideographs).)
* @defaultValue 'sans-serif'
*/
localIdeographFontFamily?: string;
localIdeographFontFamily?: string | false;
/**
* The map's MapLibre style. This must be a JSON object conforming to
* the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/),
Expand Down Expand Up @@ -464,7 +464,7 @@ export class Map extends Camera {
_renderTaskQueue: TaskQueue;
_controls: Array<IControl>;
_mapId: number;
_localIdeographFontFamily: string;
_localIdeographFontFamily: string | false;
_validateStyle: boolean;
_requestManager: RequestManager;
_locale: typeof defaultLocale;
Expand Down

0 comments on commit c0aee04

Please sign in to comment.