Esri/esri-leaflet-vector

Text is backwards in RTL language basemaps

gavinr-maps opened this issue · 2 comments

Describe the bug

The languages sample we have in the repo includes right-to-left (RTL) languages like Arabic. When those languages are chosen in the sample, the text is in the wrong direction (it is left-to-right instead of right-to-left).

Reproduction

Arabic:

  1. Open this sample that uses the ArcGIS API for JavaScript: https://jsbin.com/qohubem/2/edit?html,output

    • image
  2. In a separate tab, open this sample that uses Esri Leaflet Vector: https://jsbin.com/qategug/edit?html,output

    • image
  3. Compare the two maps

    • Expected: The map labels should look the same
    • Actual: the text in the Esri Leaflet Vector sample is backwards when compared with the ArcGIS API for JavaScript sample.

Hebrew:

Same thing for Hebrew, which is another right-to-left language:

  1. Open this sample that uses the ArcGIS API for JavaScript: https://jsbin.com/nilekem/2/edit?html,output

    • image
  2. In a separate tab, open this sample that uses Esri Leaflet Vector: https://jsbin.com/fajowaw/edit?html,output

    • image
  3. Compare the two maps

    • Expected: The map labels should look the same
    • Actual: the text in the Esri Leaflet Vector sample is backwards when compared with the ArcGIS API for JavaScript sample.

Logs

No response

System Info

- Leaflet 1.9.4
- Esri Leaflet 3.0.11
- Esri Leaflet Vector 4.1.0

Additional Information

I don't think this is a bug with Esri Leaflet Vector - I think we just need to document how to properly use RTL languages using
https://github.com/mapbox/mapbox-gl-rtl-text (via maplibre/maplibre-gl-js#220 (comment)). I think once we have an example of properly using that plugin, we must properly document how to use it in our languages sample as well as other places in the doc, like https://developers.arcgis.com/esri-leaflet/maps/change-the-place-label-language/

@gowin20 is planning on updating the Esri Leaflet Vector documentation and samples to show how to use the plugin to properly display RTL languages! Thanks @gowin20 :) !

This is resolved in #207 and that PR will be released soon.