diff --git a/examples/languages.html b/examples/languages.html index 72d256c..b79882f 100644 --- a/examples/languages.html +++ b/examples/languages.html @@ -44,7 +44,7 @@ }).setView([35.7088, 48.8790], 4); - const apiKey = "< YOUR VALID API KEY HERE >"; + const apiKey = "< YOUR ARCGIS API KEY HERE >"; const basemapStyle = "arcgis/outdoor"; @@ -98,6 +98,9 @@ L.control.layers(basemapLayers, null, { collapsed: false }).addTo(map); + // Support RTL languages such as Arabic and Hebrew + L.esri.Vector.setRTLTextPlugin('https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.js'); + diff --git a/examples/rtl-language.html b/examples/rtl-language.html new file mode 100644 index 0000000..176de73 --- /dev/null +++ b/examples/rtl-language.html @@ -0,0 +1,58 @@ + + + + + + Esri Leaflet Vector: RTL language support + + + + + + + + + + + + + + + + + +
+ + + diff --git a/package.json b/package.json index 92c60c4..61cc563 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "contributors": [ "Patrick Arlt (http://patrickarlt.com)", "Gavin Rehkemper (https://gavinr.com)", - "Jacob Wasilkowski (https://jwasilgeo.github.io)" + "Jacob Wasilkowski (https://jwasilgeo.github.io)", + "George Owen (https://geowen.dev/)" ], "bugs": { "url": "https://github.com/Esri/esri-leaflet-vector/issues" diff --git a/src/EsriLeafletVector.js b/src/EsriLeafletVector.js index bdabf58..80a1c90 100644 --- a/src/EsriLeafletVector.js +++ b/src/EsriLeafletVector.js @@ -6,4 +6,4 @@ export { version as VERSION }; export { VectorBasemapLayer, vectorBasemapLayer } from './VectorBasemapLayer'; export { VectorTileLayer, vectorTileLayer } from './VectorTileLayer'; export { EsriUtil as Util } from './Util'; -export { MaplibreGLJSLayer, maplibreGLJSLayer } from './MaplibreGLLayer'; +export { MaplibreGLJSLayer, maplibreGLJSLayer, setRTLTextPlugin } from './MaplibreGLLayer'; diff --git a/src/MaplibreGLLayer.js b/src/MaplibreGLLayer.js index 3ca9552..4184187 100644 --- a/src/MaplibreGLLayer.js +++ b/src/MaplibreGLLayer.js @@ -9,6 +9,10 @@ import { } from 'leaflet'; import maplibregl from 'maplibre-gl'; +export const setRTLTextPlugin = (url, callback, deferred) => { + maplibregl.setRTLTextPlugin(url, callback, deferred); +}; + export var MaplibreGLJSLayer = Layer.extend({ options: { updateInterval: 32,