-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: main
Are you sure you want to change the base?
add rtl text plug in #141
Conversation
add plugin Mapbox ttl
@@ -1,5 +1,16 @@ | |||
import { IControl, MapOptions as MapOptionsType } from "!maplibre-gl"; | |||
import { Map as MapType } from "maplibre-gl"; | |||
import maplibreGl from "maplibre-gl"; |
There was a problem hiding this comment.
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'; | |||
|
There was a problem hiding this comment.
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.
the map has an issue it rerenders Arabic words from left to right
I fixed it by adding an RTL plugin to maplibre using mapbox-style link