You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RTL plugin with await does not trigger a console error.
Actual Behavior
It triggers an error.
Note
Both in v3.6.1 and v4.3.2, MapLibre GL JS displays RTL works as defined in the applyArabicShaping function once the sleep time is over. To see this behavior, open one of the examples with-await links, wait for 2 seconds, then zoom in. The country labels should be replaced by RTL works now.
The text was updated successfully, but these errors were encountered:
I'm not entirely sure why there isn't an error in 3.6.1, probably a bug in the code.
The current code (and the also in version 3.6.1) assumes that the when importing the rtl script it will populate the 3 methods that are needed for shaping right after the call to import script, i.e. synchronisously.
When this happens synchronously, the code in the worker returns a response to the main thread updating about the status.
It might be that we need to change that, and only update the state of the main thread after the call to registerRTLTextPlugin is executed to allow an async type of RTL plugin method.
CC: @zhangyiatmicrosoft
Related PR and some insights on how this all works:
maplibre-gl-js version:
browser: Chrome on linux
Steps to Trigger Behavior
await
statement before the call toself.registerRTLTextPlugin()
Error: RTL Text Plugin failed to import scripts from
Link to Demonstration
https://github.com/wipfli/maplibre-rtl-regression
MapLibre GL JS v3.6.1
MapLibre GL JS v4.3.2
Expected Behavior
RTL plugin with
await
does not trigger a console error.Actual Behavior
It triggers an error.
Note
Both in v3.6.1 and v4.3.2, MapLibre GL JS displays
RTL works
as defined in theapplyArabicShaping
function once the sleep time is over. To see this behavior, open one of the exampleswith-await
links, wait for 2 seconds, then zoom in. The country labels should be replaced byRTL works
now.The text was updated successfully, but these errors were encountered: