This is an automated email from the ASF dual-hosted git repository.
bchapuis pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps-site.git
The following commit(s) were added to refs/heads/main by this push:
new 0a9d77c Add maplibre RTL text plugin to improve text rendering. (#30)
0a9d77c is described below
commit 0a9d77c04aed6fb8215889993fa1c177e889b5ca
Author: Brandon Liu <[email protected]>
AuthorDate: Mon May 29 18:31:42 2023 +0800
Add maplibre RTL text plugin to improve text rendering. (#30)
---
src/components/map/index.tsx | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/components/map/index.tsx b/src/components/map/index.tsx
index d98cdc4..054731f 100644
--- a/src/components/map/index.tsx
+++ b/src/components/map/index.tsx
@@ -62,6 +62,14 @@ export default function Map({
// Initialize map when component mounts
useEffect(() => {
+ if (maplibregl.getRTLTextPluginStatus() === 'unavailable') {
+ maplibregl.setRTLTextPlugin(
+
'https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js',
+ null,
+ true
+ );
+ }
+
const initMap = async () => {
if (ipToLoc) {
try {