Gmaps figure is not displaying the direction layer in the streamlit app

Hi, I am trying to display a gmaps figure that has a direction layer, but in the app, the direction layer is not displayed
here is the code

Durango = (37.2753,-107.880067)
SF = (37.7749,-122.419416)
#Create the map
fig = gmaps.figure()
#create the layer
layer = gmaps.directions.Directions(Durango, SF,mode='car')
#Add the layer
fig.add_layer(layer)
#Display the map
snippet = embed.embed_snippet(views=fig)
html = embed.html_template.format(title="", snippet=snippet)
components.html(html, height=1000,width=1000)

I have also tried the same code in jupyter notebook, and it’s working there

I would appreciate any help I can get, Thank You.

Unfortunately, that seems to be a known issue with gmaps that include a Directions layer Directions layer not showing via `embed_minimal_html` · Issue #351 · pbugnion/gmaps · GitHub

Hi, blackary,

Thanks for the reply. Is there a workaround for this issue?

@Mohamed_Abdullah_She I cannot figure out a workaround currently. It seems to be a bug in the underlying gmaps library. Even if you export the HTML to a file and open it up, you can see that it doesn’t show the directions. Sorry about that. You might consider adding a comment on that issue and seeing if anyone else has figured out a workaround.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.