Skip to content

Commit ca03f55

Browse files
authored
Allow disabling RTLTextPlugin and load lazy (#2312)
1 parent e11b41e commit ca03f55

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/api-reference/map.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,13 +536,13 @@ If `reuseMaps` is set to `true`, when a map component is unmounted, the underlyi
536536

537537
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.
538538

539-
#### `RTLTextPlugin`: string {#rtltextplugin}
539+
#### `RTLTextPlugin`: string | false {#rtltextplugin}
540540

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

543543
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.
544544

545-
Setting this prop is the equivelant of calling [mapboxgl.setRTLTextPlugin](https://docs.mapbox.com/mapbox-gl-js/api/properties/#setrtltextplugin) with `lazy: true`.
545+
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.
546546

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

src/utils/set-globals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type GlobalSettings = {
66
*/
77
maxParallelImageRequests?: number;
88
/** The map's RTL text plugin. Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left. */
9-
RTLTextPlugin?: string;
9+
RTLTextPlugin?: string | false;
1010
/** 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.
1111
Takes precedence over `workerUrl`. */
1212
workerClass?: any;
@@ -51,7 +51,7 @@ export default function setGlobals(mapLib: any, props: GlobalSettings) {
5151
console.error(error);
5252
}
5353
},
54-
false
54+
true
5555
);
5656
}
5757
}

0 commit comments

Comments
 (0)