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.git
The following commit(s) were added to refs/heads/main by this push:
new 0283a583 Add right-to-left plugin to the maps (#687)
0283a583 is described below
commit 0283a583d0983756bb7624bf23b424bf52b958e6
Author: Bertil Chapuis <[email protected]>
AuthorDate: Thu Jun 1 21:06:10 2023 +0200
Add right-to-left plugin to the maps (#687)
---
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',