This is an automated email from the ASF dual-hosted git repository.

bchapuis pushed a commit to branch 679-rtl
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git

commit 1119ecdb5242f36fc2975cc6209bab3ce9f98300
Author: Bertil Chapuis <[email protected]>
AuthorDate: Thu Jun 1 20:41:30 2023 +0200

    Add right-to-left plugin to the maps
---
 baremaps-server/src/main/resources/assets/server.html | 10 ++++++++++
 baremaps-server/src/main/resources/assets/viewer.html |  9 +++++++++
 2 files changed, 19 insertions(+)

diff --git a/baremaps-server/src/main/resources/assets/server.html 
b/baremaps-server/src/main/resources/assets/server.html
index 2de8631e..411383f8 100644
--- a/baremaps-server/src/main/resources/assets/server.html
+++ b/baremaps-server/src/main/resources/assets/server.html
@@ -37,6 +37,15 @@
 <div id="map"></div>
 <script>
 
+  // Load the right-to-left plugin if necessary.
+  if (maplibregl.getRTLTextPluginStatus() === 'unavailable') {
+    maplibregl.setRTLTextPlugin(
+            
'https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js',
+            null,
+            true
+    );
+  }
+
   // Initialize the map
   let map = new maplibregl.Map({
     container: 'map',
@@ -44,6 +53,7 @@
     hash: true
   });
 
+
   // Add the navigation control to the map
   map.addControl(new maplibregl.NavigationControl());
 
diff --git a/baremaps-server/src/main/resources/assets/viewer.html 
b/baremaps-server/src/main/resources/assets/viewer.html
index d70f3b45..c73ad203 100644
--- a/baremaps-server/src/main/resources/assets/viewer.html
+++ b/baremaps-server/src/main/resources/assets/viewer.html
@@ -58,6 +58,15 @@
   </div>
 <script>
 
+  // Load the right-to-left plugin if necessary.
+  if (maplibregl.getRTLTextPluginStatus() === 'unavailable') {
+    maplibregl.setRTLTextPlugin(
+            
'https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js',
+            null,
+            true
+    );
+  }
+
   // Initialize the map
   let map = new maplibregl.Map({
     container: 'map',

Reply via email to