Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,10 @@ import streamlit as st
|
|
| 3 |
def main():
|
| 4 |
st.title("Advanced Google Maps Integration in Streamlit")
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# Set initial location to New York City
|
| 7 |
initial_location = (40.7128, -74.0060)
|
| 8 |
|
|
@@ -35,7 +39,7 @@ def main():
|
|
| 35 |
|
| 36 |
# Get the selected coordinates from the JavaScript callback
|
| 37 |
if result:
|
| 38 |
-
selected_coordinates =
|
| 39 |
if selected_coordinates:
|
| 40 |
st.write(f"Selected Coordinates: {selected_coordinates[0]}, {selected_coordinates[1]}")
|
| 41 |
|
|
|
|
| 3 |
def main():
|
| 4 |
st.title("Advanced Google Maps Integration in Streamlit")
|
| 5 |
|
| 6 |
+
# Enable session state
|
| 7 |
+
st.session_state.lat = None
|
| 8 |
+
st.session_state.lng = None
|
| 9 |
+
|
| 10 |
# Set initial location to New York City
|
| 11 |
initial_location = (40.7128, -74.0060)
|
| 12 |
|
|
|
|
| 39 |
|
| 40 |
# Get the selected coordinates from the JavaScript callback
|
| 41 |
if result:
|
| 42 |
+
selected_coordinates = st.session_state.lat, st.session_state.lng
|
| 43 |
if selected_coordinates:
|
| 44 |
st.write(f"Selected Coordinates: {selected_coordinates[0]}, {selected_coordinates[1]}")
|
| 45 |
|