Spaces:
Runtime error
Runtime error
Commit
·
0750d7a
1
Parent(s):
024db11
Disable autoZooming if no nearby pages were found
Browse files- so that user can click somewhere else without having to zoom out (which takes 2-3 seconds)
- Small comment on function docstring of `generate_circle_centers` function
- backend/utils.py +1 -1
- frontend/src/components/Map.js +1 -1
backend/utils.py
CHANGED
@@ -8,7 +8,7 @@ def generate_circle_centers(center_lat, center_lon, radius_km, small_radius_km=1
|
|
8 |
- center_lat: Latitude of the center of the larger circle
|
9 |
- center_lon: Longitude of the center of the larger circle
|
10 |
- radius_km: Radius of the larger circle in kilometers
|
11 |
-
- small_radius_km: Radius of the smaller circles in kilometers (default
|
12 |
|
13 |
Output:
|
14 |
- A list of tuples, each containing the latitude and longitude of a small circle's center. [(lat1, lon1), (lat2, lon2),...]
|
|
|
8 |
- center_lat: Latitude of the center of the larger circle
|
9 |
- center_lon: Longitude of the center of the larger circle
|
10 |
- radius_km: Radius of the larger circle in kilometers
|
11 |
+
- small_radius_km: Radius of the smaller circles in kilometers (default 10km, more than that wiki api cannot accomodate)
|
12 |
|
13 |
Output:
|
14 |
- A list of tuples, each containing the latitude and longitude of a small circle's center. [(lat1, lon1), (lat2, lon2),...]
|
frontend/src/components/Map.js
CHANGED
@@ -102,7 +102,7 @@ const Map = ( { onMapClick, searchQuery, contentType, setSearchQuery, setSubmitt
|
|
102 |
|
103 |
|
104 |
useEffect(() => {
|
105 |
-
if (coordinates && Array.isArray(coordinates) && coordinates.length >
|
106 |
const bounds = L.latLngBounds(coordinates);
|
107 |
map.flyToBounds(bounds, {
|
108 |
padding: [50, 50],
|
|
|
102 |
|
103 |
|
104 |
useEffect(() => {
|
105 |
+
if (coordinates && Array.isArray(coordinates) && coordinates.length > 1 && shouldZoom) {
|
106 |
const bounds = L.latLngBounds(coordinates);
|
107 |
map.flyToBounds(bounds, {
|
108 |
padding: [50, 50],
|