diff --git a/app/main.py b/app/main.py index 25f4b2b..b431dff 100644 --- a/app/main.py +++ b/app/main.py @@ -5,8 +5,21 @@ import pydeck as pdk import streamlit as st +ICON_URL = "https://cdn-icons-png.flaticon.com/512/2060/2060364.png" +icon_data = { + # Icon from Wikimedia, used the Creative Commons Attribution-Share Alike 3.0 + # Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic licenses + "url": ICON_URL, + "width": 242, + "height": 242, + "anchorY": 242, +} + tmp_data_path = Path(__file__).parent.parent / "data" / "cameras_h3_1.csv" chart_data = pd.read_csv(tmp_data_path) +chart_data["icon_data"] = None +for i in chart_data.index: + chart_data["icon_data"][i] = icon_data st.pydeck_chart( pdk.Deck( @@ -19,11 +32,13 @@ ), layers=[ pdk.Layer( - "ScatterplotLayer", + "IconLayer", data=chart_data, + get_icon="icon_data", get_position="[longitude, latitude]", - get_color="[200, 30, 0, 160]", - get_radius=200, + get_size=4, + size_scale=5, + pickable=True, ), ], tooltip={