Spaces:
Runtime error
Runtime error
Update new_app.py
Browse files97 unmodified lines989910010110210310410510610710810911011111211311497 unmodified lineswith st.form("coords_form"):c1, c2 = st.columns(2)with c1:lat_input = st.number_input('Latitude', value=float(state.lat), min_value=-90., max_value=90., step=.01)st.write('The current lat/long are:')with c2:lng_input = st.number_input('Longitude', value=float(state.lng), min_value=-180., max_value=180., step=.01)st.write(f"{state.lat:.2f}, {state.lng:.2f}")submitted = st.form_submit_button("Get Image and Prediction")if submitted:api_key = os.getenv("goog_api", "")state.lat, state.lng = float(lat_input), float(lng_input)state.img = fetch_satellite_tile(state.lat, state.lng, api_key=api_key)with col2:if state.coords_submitted:97 unmodified lines989910010110210310410510610710810911011111211311411511611797 unmodified lineswith st.form("coords_form"):c1, c2 = st.columns(2)with c1:st.number_input('Latitude', key="lat", value=float(state.lat), min_value=-90.0, max_value=90.0, step=0.01, format="%.4f")st.write('The current lat/long are:')with c2:st.number_input('Longitude', key="lng", value=float(state.lng), min_value=-180.0, max_value=180.0, step=0.01, format="%.4f")st.write(f"{st.session_state.lat:.2f}, {st.session_state.lng:.2f}")submitted = st.form_submit_button("Get Image and Prediction")if submitted:try:api_key = os.getenv("goog_api", "")state.img = fetch_satellite_tile(st.session_state.lat, st.session_state.lng, api_key=api_key)st.rerun() # ensures the updated lat/lng render immediatelyexcept Exception as e:st.error(f"Error fetching image: {e}")with col2:if state.coords_submitted:
new_app.py+9-6