Spaces:
Runtime error
Runtime error
File size: 525 Bytes
6cc8a47 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import gradio as gr
from weather_utils import get_weather_by_coordinates
def on_map_click(latlon):
lat, lon = latlon
return get_weather_by_coordinates(lat, lon)
with gr.Blocks() as app:
gr.Markdown("## 🗺️ Hyderabad Weather Map\nClick anywhere in Hyderabad to see live weather ☁️🌧️☀️")
map_input = gr.Map(label="Click anywhere on the map", value=(17.3850, 78.4867), zoom=11)
output = gr.Markdown()
map_input.change(fn=on_map_click, inputs=map_input, outputs=output)
app.launch()
|