Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling RTLTextPlugin and load lazy #2312

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/api-reference/map.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,13 +536,13 @@ If `reuseMaps` is set to `true`, when a map component is unmounted, the underlyi

Note that since some map options cannot be modified after initialization, when reusing maps, only the reactive props and `initialViewState` of the new component are respected.

#### `RTLTextPlugin`: string {#rtltextplugin}
#### `RTLTextPlugin`: string | false {#rtltextplugin}

Default: `'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js'`

Sets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text). Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left.

Setting this prop is the equivelant of calling [mapboxgl.setRTLTextPlugin](https://docs.mapbox.com/mapbox-gl-js/api/properties/#setrtltextplugin) with `lazy: true`.
Setting this prop is the equivalent of calling [mapboxgl.setRTLTextPlugin](https://docs.mapbox.com/mapbox-gl-js/api/properties/#setrtltextplugin) with `lazy: true`. Set to `false` to disable loading the RTL text plugin.

#### `workerClass`: object {#workerclass}

Expand Down
4 changes: 2 additions & 2 deletions src/utils/set-globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type GlobalSettings = {
*/
maxParallelImageRequests?: number;
/** The map's RTL text plugin. Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left. */
RTLTextPlugin?: string;
RTLTextPlugin?: string | false;
/** Provides an interface for external module bundlers such as Webpack or Rollup to package mapbox-gl's WebWorker into a separate class and integrate it with the library.
Takes precedence over `workerUrl`. */
workerClass?: any;
Expand Down Expand Up @@ -51,7 +51,7 @@ export default function setGlobals(mapLib: any, props: GlobalSettings) {
console.error(error);
}
},
false
true
);
}
}
Loading