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

Add on-screen warning when no Mapbox token exists. #513

Merged
merged 1 commit into from
Mar 30, 2017

Conversation

ericsoco
Copy link
Contributor

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.

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.
@ericsoco
Copy link
Contributor Author

screen shot 2017-03-30 at 10 09 46 am

@@ -35,7 +35,9 @@ class App extends PureComponent {
pitch: 30,
bearing: 0
},
activeExamples: {},
activeExamples: {
ScatterplotLayer: true
Copy link
Collaborator

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() }
Copy link
Collaborator

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'}
Copy link
Collaborator

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?

@ericsoco ericsoco merged commit dc470c4 into master Mar 30, 2017
@ericsoco ericsoco mentioned this pull request Mar 30, 2017
ericsoco added a commit that referenced this pull request Mar 30, 2017
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.
gnavvy pushed a commit that referenced this pull request Mar 30, 2017
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.
@balthazar balthazar deleted the no-token-warning-clean branch March 31, 2017 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants