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

Blank map on Google Colab, Jupyter on EC2 instance and Local (windows 10) #114

Closed
rutgerhofste opened this issue Jul 3, 2018 · 10 comments · Fixed by #118
Closed

Blank map on Google Colab, Jupyter on EC2 instance and Local (windows 10) #114

rutgerhofste opened this issue Jul 3, 2018 · 10 comments · Fixed by #118

Comments

@rutgerhofste
Copy link

rutgerhofste commented Jul 3, 2018

My first baby steps with mapboxgl were no success. I get a blank map using Google Colab, Jupyter on Amazon EC2 and even running locally:

https://gist.github.com/rutgerhofste/6aadc6835699762889296437e52280d5

Am I doing something wrong or is the example no longer supported? Maybe you can add a troubleshooting section.

UPDATE: Seems like the chloropleth example is broken. Other examples work just fine.

@rutgerhofste
Copy link
Author

rutgerhofste commented Jul 3, 2018

I found the issue. The access_token = token argument is missing in some examples. Also your old keys are still visible in your commit history. You might want to revoke access to key
eyJ1IjoicnNiYXVtYW5uIiwiYSI6IjdiOWEzZGIyMGNkOGY3NWQ4ZTBhN2Y5ZGU2Mzg2NDY2In0.jycgv7qwF********cT0RaQ

@ryanbaumann
Copy link
Contributor

Thanks for the report @rutgerhofste. Can you link to the specific examples you weren't able to get to work, or did the access_token change solve your issue?

@rutgerhofste
Copy link
Author

Adding access_token solved the issue. It would be great if the examples would be all consistent. Either specify the access_token parameter everywhere or nowhere. Additionally raising an error e.g. "No valid access token" might make debugging easier. The package is extremely powerful and looking forward to see it evolve over time.

akacarlyann added a commit to akacarlyann/mapboxgl-jupyter that referenced this issue Jul 31, 2018
ryanbaumann pushed a commit that referenced this issue Aug 8, 2018
* Bugfix for #114: add access_token parameter to all ChoroplethViz examples in notebook

* Add access_token arg to LinestringViz example notebook

* Update to make sure access_token arg is consistent in all example notebooks; update for consistent alignment style (matches docs)
@adinesia
Copy link

i have the same problem, it doesn't work with mapbox, but if tried with plotly map it works. Can anyone help?

@akacarlyann
Copy link
Collaborator

@adinesia can you provide your code snippet? I'm happy to take a look. Have you checked that you have a valid access_token set in your environment or in the inialization of your viz object?

@adinesia
Copy link

Sorry, just solved the problem, i'm adding access_token just like @rutgerhofste did. Thanks a lot

@lvkrlv
Copy link

lvkrlv commented Nov 16, 2018

MapboxGL returns blank map in Jupyter Notebook, Jupyter Lab, in Chrome and Opera, using python 2 and 3. The same result every time. That's not a problem with token — it works correctly in other services.
Any ideas?

2018-11-16_21-51-07

@ryanbaumann
Copy link
Contributor

What does your developer console show?

@lvkrlv
Copy link

lvkrlv commented Nov 16, 2018

Thanks for your answer.
Console looked like there are an issue with key:

2018-11-17_00-06-26

I placed token directly inside ChoroplethViz parameters and it works:

2018-11-17_00-05-09

Thanks for reminder about console existence :-)

@akacarlyann
Copy link
Collaborator

@lvkrlv Glad you sorted it out! Looks like the syntax you want for your first try would have been
token = os.getenv('MAPBOX_ACCESS_TOKEN', your_private_access_token),
but including the token argument directly in your map initialization should always work :)

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 a pull request may close this issue.

5 participants