Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rtl text plug in #141

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

randa-11295
Copy link

  • add plugin Mapbox Rtl

the map has an issue it rerenders Arabic words from left to right

beforeRtl

I fixed it by adding an RTL plugin to maplibre using mapbox-style link

afterRtl

add plugin Mapbox ttl
@randa-11295 randa-11295 changed the title Update MapLibreGlWrapper.ts add rtl text plug in Nov 5, 2023
@@ -1,5 +1,16 @@
import { IControl, MapOptions as MapOptionsType } from "!maplibre-gl";
import { Map as MapType } from "maplibre-gl";
import maplibreGl from "maplibre-gl";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove all changes of this file. All files under the ./dist/ folder are autogenerated during the build process (yarn build). No manual changes required.

@@ -12,6 +12,16 @@ import {
StyleImageMetadata,
} from 'maplibre-gl';
import { Map as MapType, Style } from 'maplibre-gl';
import maplibregl from 'maplibre-gl';

Copy link
Member

@cioddi cioddi Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we must move this to its own hook. Let's call it useSetRtlTextPlugin (what a beautiful name :)).
This way we can use it optionally when we actually need it.

Please take a look at the useAddProtocol hook which might have a similar implementation
https://github.com/mapcomponents/react-map-components-maplibre/blob/main/src/hooks/useAddProtocol/useAddProtocol.tsx

Make the actual RTL-plugin URL a property of the hook with the current one you have in there as default value. That way it will be easy to use and still offer a way to use a custom RTL plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants