Summary
Add support for the MapLibre RTL text plugin to enable proper rendering of right-to-left languages like Arabic and Hebrew.
Problem
Currently, maps with Arabic or Hebrew labels render incorrectly - characters appear disconnected or in reverse order.
Solution
Bundle the @mapbox/mapbox-gl-rtl-text plugin with the package and automatically initialize it for all maps. This provides:
- Offline support: Plugin is bundled, no CDN dependency
- Zero configuration: Works automatically, no API changes needed
- Lazy loading: Plugin only activates when RTL text is encountered
Implementation
- Bundle
mapbox-gl-rtl-text.js in maplibre/srcjs/
- Patch
pywidget.js to expose maplibregl globally
- Modify
to_html() to inject RTL plugin as blob URL before map initialization
- Call
maplibregl.setRTLTextPlugin(blobUrl, true) before pymaplibregl(data)
Scope
This PR adds RTL support for standalone HTML rendering (Map.to_html() and Map.save()).
Shiny/Jupyter widget paths may require changes to the maplibre-bindings repo.
Summary
Add support for the MapLibre RTL text plugin to enable proper rendering of right-to-left languages like Arabic and Hebrew.
Problem
Currently, maps with Arabic or Hebrew labels render incorrectly - characters appear disconnected or in reverse order.
Solution
Bundle the
@mapbox/mapbox-gl-rtl-textplugin with the package and automatically initialize it for all maps. This provides:Implementation
mapbox-gl-rtl-text.jsinmaplibre/srcjs/pywidget.jsto exposemaplibreglgloballyto_html()to inject RTL plugin as blob URL before map initializationmaplibregl.setRTLTextPlugin(blobUrl, true)beforepymaplibregl(data)Scope
This PR adds RTL support for standalone HTML rendering (
Map.to_html()andMap.save()).Shiny/Jupyter widget paths may require changes to the
maplibre-bindingsrepo.