Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,8 +4,6 @@ import requests
|
|
| 4 |
st.title("📍 Get Your Device Location")
|
| 5 |
|
| 6 |
# Inject JavaScript to get location from the browser
|
| 7 |
-
st.write("Click the button below to get your device's location.")
|
| 8 |
-
|
| 9 |
get_location_js = """
|
| 10 |
<script>
|
| 11 |
navigator.geolocation.getCurrentPosition(
|
|
@@ -27,7 +25,7 @@ st.markdown('<input type="hidden" id="location-data">', unsafe_allow_html=True)
|
|
| 27 |
# Create a form to capture location data
|
| 28 |
with st.form("location_form"):
|
| 29 |
location = st.text_input("Your Coordinates", key="location", disabled=True)
|
| 30 |
-
submitted = st.form_submit_button("Submit"
|
| 31 |
|
| 32 |
# Run the JavaScript when the user clicks the button
|
| 33 |
st.markdown(get_location_js, unsafe_allow_html=True)
|
|
|
|
| 4 |
st.title("📍 Get Your Device Location")
|
| 5 |
|
| 6 |
# Inject JavaScript to get location from the browser
|
|
|
|
|
|
|
| 7 |
get_location_js = """
|
| 8 |
<script>
|
| 9 |
navigator.geolocation.getCurrentPosition(
|
|
|
|
| 25 |
# Create a form to capture location data
|
| 26 |
with st.form("location_form"):
|
| 27 |
location = st.text_input("Your Coordinates", key="location", disabled=True)
|
| 28 |
+
submitted = st.form_submit_button("Submit") # Fixed: Removed 'key' argument
|
| 29 |
|
| 30 |
# Run the JavaScript when the user clicks the button
|
| 31 |
st.markdown(get_location_js, unsafe_allow_html=True)
|