Skip to content

Commit

Permalink
[Feat] Use custom style token if available instead of the default tok…
Browse files Browse the repository at this point in the history
…en (#1913)
  • Loading branch information
igorDykhta committed Aug 9, 2022
1 parent 77dc256 commit f82494d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/map-container.tsx
Expand Up @@ -583,12 +583,14 @@ export default function MapContainerFactory(
const layersToRender = this.layersToRenderSelector(this.props);
const layersForDeck = this.layersForDeckSelector(this.props);

// Current style can be a custom style, from which we pull the mapbox API acccess token
const currentStyle = mapStyle.mapStyles?.[mapStyle.styleType];
const mapProps = {
...mapState,
width: '100%',
height: '100%',
preserveDrawingBuffer: true,
mapboxApiAccessToken,
mapboxApiAccessToken: currentStyle?.accessToken || mapboxApiAccessToken,
mapboxApiUrl,
onViewportChange: this._onViewportChange,
transformRequest
Expand Down
1 change: 1 addition & 0 deletions src/reducers/map-style-updaters.ts
Expand Up @@ -66,6 +66,7 @@ export type BaseMapStyle = {
icon: string;
style?: Object;
layerGroups: LayerGroup[];
accessToken?: string;
};

export type MapStyles = {
Expand Down

0 comments on commit f82494d

Please sign in to comment.