Spaces:
Sleeping
Sleeping
Commit
Β·
f1d54eb
1
Parent(s):
5f60341
elegeant copy
Browse files
app.py
CHANGED
|
@@ -127,22 +127,22 @@ with st.sidebar:
|
|
| 127 |
# Add example URL and link
|
| 128 |
example_url = "https://www.google.com/maps/@37.8728123,-122.2445339,3a,75y,3.36h,90t/data=!3m7!1e1!3m5!1s4DTABKOpCL6hdNRgnAHTgw!2e0!6shttps:%2F%2Fstreetviewpixels-pa.googleapis.com%2Fv1%2Fthumbnail%3Fcb_client%3Dmaps_sv.tactile%26w%3D900%26h%3D600%26pitch%3D0%26panoid%3D4DTABKOpCL6hdNRgnAHTgw%26yaw%3D3.3576431!7i13312!8i6656?entry=ttu"
|
| 129 |
|
| 130 |
-
# Create
|
| 131 |
-
|
| 132 |
|
| 133 |
-
with
|
| 134 |
-
|
| 135 |
-
"Google Maps URL",
|
| 136 |
-
placeholder="https://www.google.com/maps/@37.5851338,-122.1519467,9z?entry=ttu"
|
| 137 |
-
)
|
| 138 |
|
| 139 |
-
with
|
| 140 |
-
if st.button("π
|
| 141 |
-
|
| 142 |
-
st.
|
| 143 |
|
| 144 |
-
#
|
| 145 |
-
st.
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
if google_url:
|
| 148 |
mapcrunch_url = convert_google_to_mapcrunch_url(google_url)
|
|
@@ -160,7 +160,7 @@ with st.sidebar:
|
|
| 160 |
st.error("Invalid Google Maps URL format")
|
| 161 |
st.stop()
|
| 162 |
else:
|
| 163 |
-
st.warning("Please enter a Google Maps URL
|
| 164 |
st.stop()
|
| 165 |
|
| 166 |
model_choice = st.selectbox("Model", list(MODELS_CONFIG.keys()), index=list(MODELS_CONFIG.keys()).index(DEFAULT_MODEL))
|
|
|
|
| 127 |
# Add example URL and link
|
| 128 |
example_url = "https://www.google.com/maps/@37.8728123,-122.2445339,3a,75y,3.36h,90t/data=!3m7!1e1!3m5!1s4DTABKOpCL6hdNRgnAHTgw!2e0!6shttps:%2F%2Fstreetviewpixels-pa.googleapis.com%2Fv1%2Fthumbnail%3Fcb_client%3Dmaps_sv.tactile%26w%3D900%26h%3D600%26pitch%3D0%26panoid%3D4DTABKOpCL6hdNRgnAHTgw%26yaw%3D3.3576431!7i13312!8i6656?entry=ttu"
|
| 129 |
|
| 130 |
+
# Create columns for the example URL display
|
| 131 |
+
example_col1, example_col2 = st.columns([4, 1])
|
| 132 |
|
| 133 |
+
with example_col1:
|
| 134 |
+
st.markdown(f"π‘ **Example Location:** [View in Google Maps]({example_url})")
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
+
with example_col2:
|
| 137 |
+
if st.button("π Copy", key="copy_example", use_container_width=True):
|
| 138 |
+
st.write(f'<script>navigator.clipboard.writeText("{example_url}")</script>', unsafe_allow_html=True)
|
| 139 |
+
st.success("Copied!")
|
| 140 |
|
| 141 |
+
# URL input
|
| 142 |
+
google_url = st.text_input(
|
| 143 |
+
"Google Maps URL",
|
| 144 |
+
placeholder="https://www.google.com/maps/@37.5851338,-122.1519467,9z?entry=ttu"
|
| 145 |
+
)
|
| 146 |
|
| 147 |
if google_url:
|
| 148 |
mapcrunch_url = convert_google_to_mapcrunch_url(google_url)
|
|
|
|
| 160 |
st.error("Invalid Google Maps URL format")
|
| 161 |
st.stop()
|
| 162 |
else:
|
| 163 |
+
st.warning("Please enter a Google Maps URL")
|
| 164 |
st.stop()
|
| 165 |
|
| 166 |
model_choice = st.selectbox("Model", list(MODELS_CONFIG.keys()), index=list(MODELS_CONFIG.keys()).index(DEFAULT_MODEL))
|