我正在构建一个流光应用程序,它将显示一张带有lat和长标记的地图。我用folium来显示地图。我如何将图像添加到地图上,以便当我悬停在标记上时,弹出就会显示该标记的图像?图像采用s3静态格式。
http://...../84f18d80-4125-11ed-80ab-f4ee08f238f9.jpg
import streamlit as st
import leafmap.foliumap as leafmap
st.dataframe(df)
m = leafmap.Map(center=(-31.416668, -64.183334), zoom=5)
m.add_circle_markers_from_xy(df, x="longitude", y="latitude")
m.Popup()图像位于"image“列的dataframe上。

所以当我悬停在其中一个标记上时,我想看到那个特定标记的图像。

发布于 2022-10-04 09:36:44
"image“列中的字符串被解释为HTML代码。因此,您可以修改" image“列以在弹出窗口中添加图像并选择其大小:
df["image"] = "<img src='" + df["image"] + "' width=100>" # Modify the link into HTML code
...
m.add_circle_markers_from_xy(df, x="longitude", y="latitude", popup="image") # add the image column to the popup parameterhttps://stackoverflow.com/questions/73915380
复制相似问题