mapbox / mapbox-gl-rtl-text

Add right-to-left text support to Mapbox GL JS
Other
53 stars 20 forks source link

how to use it with React #11

Closed a-m-dev closed 6 years ago

a-m-dev commented 6 years ago

hello how can i use this plugin with react ?????

a-m-dev commented 6 years ago

i solved it like this 👍

import React from "react";
import ReactDOM from "react-dom";
import "./styles.css";
import ReactMapboxGl, { Layer, Feature } from "react-mapbox-gl";

// by adding this two lines , make sure to install mapbox-gl 
import { setRTLTextPlugin } from "mapbox-gl";
setRTLTextPlugin("https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.1.2/mapbox-gl-rtl-text.js");

....
dannykennedy commented 3 years ago

This solution doesn't work for me when using custom labels (symbols) via the <Source> and <Layer> components.

ryanhamley commented 3 years ago

@dannykennedy This might be a better question for react-mapbox-gl. We don't maintain that library and I'm not sure how this plugin may interact with it. If you need further assistance on our side, contact Mapbox Support.