We’ll move this to the documentation, but in the meantime…
For anyone coming across an issue where custom functionality doesn’t get picked up when using a Mapbox token, please be sure to copy your Mapbox token into your config.toml
file. Streamlit currently does not pick up tokens from inside a Python script, as we expect that users wouldn’t want to commit tokens into a version control system (we’ll re-evaluate that assumption internally).
To add your Mapbox token, please add the following line to your config.toml
file (or create one if necessary):
[mapbox]
# Configure Streamlit to use a custom Mapbox token for elements like st.deck_gl_chart and st.map. To get a token for yourself, create an account at https://mapbox.com. It's free (for moderate usage levels)!
# Default: ""
token = ""
ref: https://docs.streamlit.io/en/stable/cli.html?highlight=config.toml#view-all-config-options