Spaces:
Running
Running
fschwartzer
commited on
Commit
•
5db2dc0
1
Parent(s):
be17c91
Update app.py
Browse files
app.py
CHANGED
@@ -90,18 +90,17 @@ with st.sidebar:
|
|
90 |
zoom_level = st.slider('Nível de zoom', min_value=1, max_value=15, value=zoom_level)
|
91 |
else:
|
92 |
# Find the maximum distance between coordinates for the entire dataset
|
93 |
-
max_distance_all = 0
|
94 |
for index, row in data.iterrows():
|
95 |
distance_all = calculate_distance(row['latitude'], row['longitude'], data['latitude'].mean(), data['longitude'].mean())
|
96 |
if distance_all > max_distance_all:
|
97 |
max_distance_all = distance_all
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
# Slider for setting the zoom level based on the entire dataset
|
103 |
-
zoom_level = st.slider('Nível de zoom', min_value=1, max_value=15, value=zoom_level_all)
|
104 |
|
|
|
|
|
105 |
|
106 |
# Conditionally render the radius slider
|
107 |
if radius_visible:
|
|
|
90 |
zoom_level = st.slider('Nível de zoom', min_value=1, max_value=15, value=zoom_level)
|
91 |
else:
|
92 |
# Find the maximum distance between coordinates for the entire dataset
|
93 |
+
max_distance_all = 0 # Initialize max_distance_all
|
94 |
for index, row in data.iterrows():
|
95 |
distance_all = calculate_distance(row['latitude'], row['longitude'], data['latitude'].mean(), data['longitude'].mean())
|
96 |
if distance_all > max_distance_all:
|
97 |
max_distance_all = distance_all
|
98 |
|
99 |
+
# Calculate a zoom level based on the maximum distance of the entire dataset
|
100 |
+
zoom_level_all = round(15 - np.log10(max_distance_all))
|
|
|
|
|
|
|
101 |
|
102 |
+
# Slider for setting the zoom level based on the entire dataset
|
103 |
+
zoom_level = st.slider('Nível de zoom', min_value=1, max_value=15, value=zoom_level_all)
|
104 |
|
105 |
# Conditionally render the radius slider
|
106 |
if radius_visible:
|