Skip to content
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

[Feat] Use custom style token if available instead of the default token #1913

Merged
merged 2 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/map-container.tsx
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export type BaseMapStyle = {
icon: string;
style?: Object;
layerGroups: LayerGroup[];
accessToken?: string;
};

export type MapStyles = {
Expand Down