React wrapper for mapbox-gl-js. Expose a bunch of component meant to be simple to use for React.
🔑 You should first get api key from Map.ir
npm i mapir-react-component
import Mapir from 'mapir-react-component';
import 'mapir-react-component/dist/index.css';
const Map = Mapir.setToken({
transformRequest: (url) => {
return {
url: url,
headers: {
'x-api-key': 'Your_API_KEY', //Mapir api key
'Mapir-SDK': 'reactjs',
},
};
},
});
render () {
return (
<Mapir
Map={Map}
apiKey={'Your_API_KEY'}
/>
)
}