Google map does not display correctly in jupyter n

2020-07-18 07:20发布

问题:

I'm trying to use google map API to visualize some data in jupyter notebook. Here is the code I used to display basic map in jupyter:

import gmaps
import os
import json
import gmaps.datasets

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

fig=gmaps.figure()

fig

After I ran the code, nothing was displayed. I used my own google API key and couldn't figure out why the map isn't displayed. I'm new to the geojson field, so any idea or thoughts is appreciated.

回答1:

Did you make sure Widgets are enabled in your jupyter? try this before you run Jupyter:

jupyter nbextension enable --py gmaps
jupyter nbextension enable --py widgetsnbextension