I am trying to display the map given by Google Maps API using python gmaps library on streamlit. I know that there are other ways to plot maps like folium or with st.map but I would like to use directly the google maps one. Notebook example:
Hi @AelxRossi, welcome to the Streamlit community!
From a quick reading of the gmaps source code, it looks like they might be doing this via a ipywidgets display. If so, that’s not currently able to be embedded within Streamlit.
Traceback (most recent call last):
File “C:\Users\vansa\anaconda3\envs\PSAK73\lib\site-packages\streamlit\scriptrunner\script_runner.py”, line 554, in _run_script
exec(code, module.dict)
File “gmaps.py”, line 36, in
snippet = embed.embed_snippet(views=map)
File “C:\Users\vansa\anaconda3\envs\PSAK73\lib\site-packages\ipywidgets\embed.py”, line 264, in embed_snippet
data = embed_data(views, drop_defaults=drop_defaults, state=state)
File “C:\Users\vansa\anaconda3\envs\PSAK73\lib\site-packages\ipywidgets\embed.py”, line 226, in embed_data
view_specs = [w.get_view_spec() for w in views]
File “C:\Users\vansa\anaconda3\envs\PSAK73\lib\site-packages\ipywidgets\embed.py”, line 226, in
view_specs = [w.get_view_spec() for w in views]
AttributeError: type object ‘map’ has no attribute ‘get_view_spec’