diff --git a/README.rst b/README.rst index 0da53e4..ee11467 100644 --- a/README.rst +++ b/README.rst @@ -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 `_. 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 `_. 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 ------------- diff --git a/docs/source/authentication.rst b/docs/source/authentication.rst index c26458e..f792ad7 100644 --- a/docs/source/authentication.rst +++ b/docs/source/authentication.rst @@ -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 `_. 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 `_. Add the following line to your shell start-up file (probably `~/.profile` or `~/.bashrc`):: export GOOGLE_API_KEY=AI... @@ -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.