fix(web): handle RTL languages in the map component (#12308)

This commit is contained in:
Zack Pollard 2024-09-04 17:02:37 +01:00 committed by GitHub
parent d685bc1f34
commit 1783dfd393
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 119 additions and 2 deletions

View file

@ -7,6 +7,7 @@
import { mdiCog, mdiMap, mdiMapMarker } from '@mdi/js';
import type { Feature, GeoJsonProperties, Geometry, Point } from 'geojson';
import type { GeoJSONSource, LngLatLike, StyleSpecification } from 'maplibre-gl';
import mapboxRtlUrl from '@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.min.js?url';
import maplibregl from 'maplibre-gl';
import { createEventDispatcher } from 'svelte';
import {
@ -51,6 +52,8 @@
let map: maplibregl.Map;
let marker: maplibregl.Marker | null = null;
void maplibregl.setRTLTextPlugin(mapboxRtlUrl, true);
$: style = (() =>
getMapStyle({
theme: ($mapSettings.allowDarkMode ? $colorTheme.value : Theme.LIGHT) as unknown as MapTheme,