Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,10 +16,14 @@ def update_map(csv_file):
|
|
16 |
return df, Folium(value=Map(location=[df.iloc[0]['Latitude'], df.iloc[0]['Longitude']], zoom_start=10), height=400)
|
17 |
|
18 |
# Function to update location on map based on selected data row
|
19 |
-
def
|
20 |
row = data.iloc[0, :]
|
21 |
return Map(location=[row['Latitude'], row['Longitude']], zoom_start=10)
|
22 |
|
|
|
|
|
|
|
|
|
23 |
# Gradio Blocks
|
24 |
with gr.Blocks() as demo:
|
25 |
gr.Markdown("# 🗺️ Explore AI Data Maps with Gradio and Folium\n"
|
|
|
16 |
return df, Folium(value=Map(location=[df.iloc[0]['Latitude'], df.iloc[0]['Longitude']], zoom_start=10), height=400)
|
17 |
|
18 |
# Function to update location on map based on selected data row
|
19 |
+
def select_experimental(data: gr.Dataframe):
|
20 |
row = data.iloc[0, :]
|
21 |
return Map(location=[row['Latitude'], row['Longitude']], zoom_start=10)
|
22 |
|
23 |
+
def select(df, data: gr.SelectData):
|
24 |
+
row = df.iloc[data.index[0], :]
|
25 |
+
return Map(location=[row['Latitude'], row['Longitude']])
|
26 |
+
|
27 |
# Gradio Blocks
|
28 |
with gr.Blocks() as demo:
|
29 |
gr.Markdown("# 🗺️ Explore AI Data Maps with Gradio and Folium\n"
|