-
Notifications
You must be signed in to change notification settings - Fork 258
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
Enabling API key handling (MissingKeyMapError) #16
Comments
a quick workaround until it is fixed:
I wrote this because I needed it right now :-) |
@santoshphilip could you please explain more about htmltxt and apikey? i couldn't manage to do it |
I have not used it since I wrote it - so my recollection of this is a little fuzzy.
You need to get the API key from google (the google maps page may guide on this) Having said this, all of the above is from almost a year back. I have not tested the code to see if it still works. Things may have changed since then. Good luck |
Here is my fix for using this in flask. All you need to do is add &key= to the already existing visualization line.
Hope that helps. |
Here is an update to @santoshphilip 's code: def insertapikey(fname, apikey):
if name == 'main': NB:
|
In case anybody encounters the same problem, here is the workaround i've been using for Jupyter / IPython. from IPython.display import IFrame
def jupyter_display(gmplot_filename, google_api_key):
"""Hack to display a gmplot map in Jupyter"""
with open(gmplot_filename, "r+b") as f:
f_string = f.read()
url_pattern = "https://maps.googleapis.com/maps/api/js?libraries=visualization&sensor=true_or_false"
f_string = f_string.replace(url_pattern, url_pattern + "&key=%s" % google_api_key)
f.write(f_string)
return IFrame(gmplot_filename, width=990, height=500) |
Merged api key branch. Reopen if the issue is still present. fwiw, I've been using api-less plotting since this ticket was opened without issue. I understand the notebooks may be a bit different. |
It looks like Google Maps no longer allows key-less API access as of yesterday June 22th. This will probably require to enable passing an API key to gmplot. Currently using gmplot fails with
MissingKeyMapError
.The text was updated successfully, but these errors were encountered: