Skip to content

Commit

Permalink
Add mapbox-gl-rtl-text library
Browse files Browse the repository at this point in the history
This adds support for RTL languages (Arabic and Hebrew) in the basemaps.
Without this library the RTL languages appear backwards.
  • Loading branch information
nickpeihl committed Jan 14, 2020
1 parent daeddfd commit 85ea63c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { getGlyphUrl, isRetina } from '../../../meta';
import { DECIMAL_DEGREES_PRECISION, ZOOM_PRECISION } from '../../../../common/constants';
import mapboxgl from 'mapbox-gl/dist/mapbox-gl-csp';
import mbWorkerUrl from '!!file-loader!mapbox-gl/dist/mapbox-gl-csp-worker';
import mbRtlPlugin from '!!file-loader!@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.min.js';
import chrome from 'ui/chrome';
import { spritesheet } from '@elastic/maki';
import sprites1 from '@elastic/maki/dist/sprite@1.png';
Expand All @@ -24,6 +25,7 @@ import { DrawControl } from './draw_control';
import { TooltipControl } from './tooltip_control';

mapboxgl.workerUrl = mbWorkerUrl;
mapboxgl.setRTLTextPlugin(mbRtlPlugin);

export class MBMapContainer extends React.Component {
state = {
Expand Down
1 change: 1 addition & 0 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
"@kbn/interpreter": "1.0.0",
"@kbn/ui-framework": "1.0.0",
"@mapbox/mapbox-gl-draw": "^1.1.1",
"@mapbox/mapbox-gl-rtl-text": "0.2.3",
"@scant/router": "^0.1.0",
"@slack/webhook": "^5.0.0",
"@turf/boolean-contains": "6.0.1",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2204,6 +2204,11 @@
lodash.isequal "^4.2.0"
xtend "^4.0.1"

"@mapbox/mapbox-gl-rtl-text@0.2.3":
version "0.2.3"
resolved "https://registry.yarnpkg.com/@mapbox/mapbox-gl-rtl-text/-/mapbox-gl-rtl-text-0.2.3.tgz#a26ecfb3f0061456d93ee8570dd9587d226ea8bd"
integrity sha512-RaCYfnxULUUUxNwcUimV9C/o2295ktTyLEUzD/+VWkqXqvaVfFcZ5slytGzb2Sd/Jj4MlbxD0DCZbfa6CzcmMw==

"@mapbox/mapbox-gl-supported@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.4.0.tgz#36946b22944fe2cfa43cfafd5ef36fdb54a069e4"
Expand Down

0 comments on commit 85ea63c

Please sign in to comment.