From 082e1c465ef9ce626f83f6e91712a1063c275cf6 Mon Sep 17 00:00:00 2001 From: Jason Tuenge Date: Tue, 26 May 2020 08:49:32 -0700 Subject: [PATCH 1/2] removing bad configure guidance and adding note regarding billing that should be on documentation page --- README.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 ------------- From 93b79b6471fce5b52f3f837bce26ddacc642a8c9 Mon Sep 17 00:00:00 2001 From: Jason Tuenge Date: Sun, 31 May 2020 09:59:35 -0700 Subject: [PATCH 2/2] revising documentation to align with PR 339 --- docs/source/authentication.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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.