Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,25 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
|
| 4 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
+
def main():
|
| 4 |
+
st.title("Google Maps Integration in Streamlit")
|
| 5 |
+
|
| 6 |
+
# Set initial location to New York City
|
| 7 |
+
initial_location = (40.7128, -74.0060)
|
| 8 |
+
|
| 9 |
+
# Display Google Map with a location picker using HTML and JavaScript
|
| 10 |
+
st.write("Pick a location on the map:")
|
| 11 |
+
map_code = f"""
|
| 12 |
+
<iframe
|
| 13 |
+
width="800"
|
| 14 |
+
height="500"
|
| 15 |
+
frameborder="0"
|
| 16 |
+
scrolling="no"
|
| 17 |
+
marginheight="0"
|
| 18 |
+
marginwidth="0"
|
| 19 |
+
src="https://maps.google.com/maps?q={initial_location[0]},{initial_location[1]}&z=15&output=embed"
|
| 20 |
+
></iframe>
|
| 21 |
+
"""
|
| 22 |
+
st.components.v1.html(map_code, height=600)
|
| 23 |
+
|
| 24 |
+
if __name__ == "__main__":
|
| 25 |
+
main()
|