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

removing bad configure guidance and adding note regarding billing #339

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,7 @@ You will then need to rebuild JupyterLab with::
Google API keys
---------------

To access Google maps, `gmaps` needs a Google API key. This key tells Google who you are, presumably so it can keep track of rate limits and such things. To create an API key, follow the instructions in the `documentation <http://jupyter-gmaps.readthedocs.io/en/latest/authentication.html>`_. Once you have an API key, pass it to `gmaps` before creating widgets:

.. code:: python

gmaps.configure(api_key="AI...")
To access Google maps, `gmaps` needs a Google API key. This key tells Google who you are, presumably so it can keep track of rate limits and such things. To create an API key, follow the instructions in the `documentation <http://jupyter-gmaps.readthedocs.io/en/latest/authentication.html>`_. Once you have an API key, pass it to `gmaps` before creating widgets (still following the instructions in the documentation). If you get a "this page can't load Google maps correctly" error, review the tips provided at the webpage linked from the "do you own this website" text provided in the error message; for example, you may not have properly configured billing for the GCP project associated with the API.

Documentation
-------------
Expand Down
10 changes: 4 additions & 6 deletions docs/source/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ Most operations on Google Maps require that you tell Google who you are. To auth

.. image:: _images/api_key.*

You can pass this key to `gmaps` with the ``configure`` method::
You can pass this key to `gmaps` with the ``configure`` method. Maps and layers created after the call to ``gmaps.configure`` will have access to the API key.

gmaps.configure(api_key="AI...")

Maps and layers created after the call to ``gmaps.configure`` will have access to the API key.

You should avoid hard-coding the API key into your Jupyter notebooks. You can use `environment variables <https://en.wikipedia.org/wiki/Environment_variable>`_. Add the following line to your shell start-up file (probably `~/.profile` or `~/.bashrc`)::
However, you should avoid hard-coding the API key into your Jupyter notebooks. You can use `environment variables <https://en.wikipedia.org/wiki/Environment_variable>`_. Add the following line to your shell start-up file (probably `~/.profile` or `~/.bashrc`)::

export GOOGLE_API_KEY=AI...

Expand All @@ -22,3 +18,5 @@ Make sure you don't put spaces around the ``=`` sign. If you then open a `new` t
import gmaps

gmaps.configure(api_key=os.environ["GOOGLE_API_KEY"])

If you get a "this page can't load Google maps correctly" error in your Jupyter Notebook, review the tips provided at the webpage linked from the "do you own this website" text provided in the error message; for example, you may not have properly configured billing for the GCP project associated with the API.