-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add on-screen warning when no Mapbox token exists. #513
Conversation
Also turn on ScatterplotLayer by default; without anything visible on the map, the example feels unfinished IMO. (Especially when there's no basemap visible.) But open to disagreement on that.
@@ -35,7 +35,9 @@ class App extends PureComponent { | |||
pitch: 30, | |||
bearing: 0 | |||
}, | |||
activeExamples: {}, | |||
activeExamples: { | |||
ScatterplotLayer: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment here stating the logic (same text you put in this PR)
render() { | ||
const {settings, activeExamples, hoveredItem, clickedItem} = this.state; | ||
|
||
return ( | ||
<div> | ||
{ this._renderMap() } | ||
{ !MAPBOX_ACCESS_TOKEN && this._renderNoTokenWarning() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could move this check inside the function.
@@ -176,7 +178,7 @@ class App extends PureComponent { | |||
const {width, height, mapViewState, settings: {effects}} = this.state; | |||
return ( | |||
<MapboxGLMap | |||
mapboxApiAccessToken={MAPBOX_ACCESS_TOKEN} | |||
mapboxApiAccessToken={MAPBOX_ACCESS_TOKEN || 'no_token'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does sending in 'no_token' achieve?
Also turn on ScatterplotLayer by default; without anything visible on the map, the example feels unfinished IMO. (Especially when there's no basemap visible.) But open to disagreement on that.
Also turn on ScatterplotLayer by default; without anything visible on the map, the example feels unfinished IMO. (Especially when there's no basemap visible.) But open to disagreement on that.
Also turn on ScatterplotLayer by default; without anything visible on the map, the example feels unfinished IMO. (Especially when there's no basemap visible.) But open to disagreement on that.
Supercedes #509, which had an errant commit from another branch.