I am using react-leaflet with tile provider Stadia OSM bright. when I run it locally Is showing tiles but when I make build and upload to server It stops loading tiles and starts giving request 403 forbidden error. I have an API key but not finding any solution where to put it in the component. here is a code sample
render() {
const headeris = {"Authorization": "Stadia-Auth "+this.state.authkey}
return (
<LeafletMaps
center={[this.state.lat, this.state.lng]}
zoom={12}
maxZoom={17}
attributionControl={true}
zoomControl={true}
doubleClickZoom={true}
scrollWheelZoom={true}
dragging={true}
animate={true}
easeLinearity={0.5}
>
<TileLayer
url="https://tiles.stadiamaps.com/tiles/osm_bright/{z}/{x}/{y}{r}.png"
attribution= '© <a href="https://stadiamaps.com/">Stadia Maps</a>, © <a href="https://openmaptiles.org/">OpenMapTiles</a> © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'
/>
{this.state.markers.map((position, index) => (
<Marker
key={`marker-${index}`}
position={[position[0][4], position[0][5]]}
>
<Popup>
<p>{position[0][0]}</p>
<a href={`/admin/calender/${position[0][2]}`}>Book now</a>
</Popup>
</Marker>
))}
</LeafletMaps>
);