Write me an app that displays a map that zooms to user input coordinates
To upload files, please first save the app
import streamlit as st
import pandas as pd
import numpy as np
st.title("Coordinate Map Viewer")
col1, col2 = st.columns(2)
with col1:
latitude = st.number_input("Enter Latitude",
min_value=-90.0,
max_value=90.0,
value=0.0,
step=0.1)
with col2:
longitude = st.number_input("Enter Longitude",
min_value=-180.0,
max_value=180.0,
value=0.0,
step=0.1)
# Create a single-row DataFrame with the coordinates
df = pd.DataFrame({
'lat': [latitude],
'lon': [longitude]
})
# Display the map centered on the input coordinates
st.map(df, zoom=8)
# Display the coordinates as text
st.write(f"Selected coordinates: {latitude}°, {longitude}°")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?