File size: 592 Bytes
798d1ce
 
5fd9945
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import streamlit as st
import plotly.express as px
import geopandas as gpd

def display_map(df):
    # Assuming the data contains Latitude and Longitude fields for the poles
    # Creating a GeoDataFrame
    gdf = gpd.GeoDataFrame(df, geometry=gpd.points_from_xy(df['Longitude'], df['Latitude']))
    # Plot the map
    fig = px.scatter_mapbox(gdf, lat=gdf.geometry.y, lon=gdf.geometry.x, color='Alert Level', size_max=10, 
                            color_continuous_scale='Reds', hover_name='Pole ID', zoom=7)
    fig.update_layout(mapbox_style="open-street-map")
    st.plotly_chart(fig)