Chrisyichuan commited on
Commit
cbe043e
Β·
1 Parent(s): eef3b2c

add raw online mode and give an example and allow paste to the empty bar

Browse files
Files changed (1) hide show
  1. app.py +17 -7
app.py CHANGED
@@ -126,13 +126,23 @@ with st.sidebar:
126
 
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
- st.markdown(f"πŸ’‘ **Example URL:** [View in Google Maps]({example_url})")
130
 
131
- google_url = st.text_input(
132
- "Google Maps URL",
133
- value=example_url,
134
- placeholder="https://www.google.com/maps/@37.5851338,-122.1519467,9z?entry=ttu"
135
- )
 
 
 
 
 
 
 
 
 
 
 
136
 
137
  if google_url:
138
  mapcrunch_url = convert_google_to_mapcrunch_url(google_url)
@@ -150,7 +160,7 @@ with st.sidebar:
150
  st.error("Invalid Google Maps URL format")
151
  st.stop()
152
  else:
153
- st.warning("Please enter a Google Maps URL")
154
  st.stop()
155
 
156
  model_choice = st.selectbox("Model", list(MODELS_CONFIG.keys()), index=list(MODELS_CONFIG.keys()).index(DEFAULT_MODEL))
 
126
 
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 two columns for the URL input and paste button
131
+ url_col1, url_col2 = st.columns([3, 1])
132
+
133
+ with url_col1:
134
+ google_url = st.text_input(
135
+ "Google Maps URL",
136
+ placeholder="https://www.google.com/maps/@37.5851338,-122.1519467,9z?entry=ttu"
137
+ )
138
+
139
+ with url_col2:
140
+ if st.button("πŸ“‹ Paste Example", use_container_width=True):
141
+ google_url = example_url
142
+ st.experimental_rerun()
143
+
144
+ # Show the example link
145
+ st.markdown(f"πŸ’‘ **Example Location:** [View in Google Maps]({example_url})")
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 or click 'Paste Example'")
164
  st.stop()
165
 
166
  model_choice = st.selectbox("Model", list(MODELS_CONFIG.keys()), index=list(MODELS_CONFIG.keys()).index(DEFAULT_MODEL))