Update app.py
Browse files
app.py
CHANGED
|
@@ -31,17 +31,16 @@ def main():
|
|
| 31 |
var lng = event.latLng.lng();
|
| 32 |
var message = 'Selected Coordinates: ' + lat + ', ' + lng;
|
| 33 |
document.getElementById('selected-coordinates').innerHTML = message;
|
| 34 |
-
Streamlit.
|
| 35 |
}}
|
| 36 |
</script>
|
| 37 |
"""
|
| 38 |
-
|
| 39 |
|
| 40 |
-
# Get the selected coordinates from the
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
st.write(f"Selected Coordinates: {selected_coordinates[0]}, {selected_coordinates[1]}")
|
| 45 |
|
| 46 |
if __name__ == "__main__":
|
| 47 |
main()
|
|
|
|
| 31 |
var lng = event.latLng.lng();
|
| 32 |
var message = 'Selected Coordinates: ' + lat + ', ' + lng;
|
| 33 |
document.getElementById('selected-coordinates').innerHTML = message;
|
| 34 |
+
Streamlit.setSessionState({{ lat: lat, lng: lng }});
|
| 35 |
}}
|
| 36 |
</script>
|
| 37 |
"""
|
| 38 |
+
st.components.v1.html(map_code, height=600, scrolling=True)
|
| 39 |
|
| 40 |
+
# Get the selected coordinates from the session state
|
| 41 |
+
selected_coordinates = st.session_state.lat, st.session_state.lng
|
| 42 |
+
if selected_coordinates[0] is not None and selected_coordinates[1] is not None:
|
| 43 |
+
st.write(f"Selected Coordinates: {selected_coordinates[0]}, {selected_coordinates[1]}")
|
|
|
|
| 44 |
|
| 45 |
if __name__ == "__main__":
|
| 46 |
main()
|