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’
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.