Spaces:
Runtime error
Runtime error
Commit
·
294e850
1
Parent(s):
0b5acb5
Replace slider with keyboard input
Browse files- Fixed the slider not reaching full slider length (issue was the min being 10 and step being 1000)
- Then replaced it altogether with slider for better control.
- Keeping default radius as 10km.
frontend/src/components/Map.js
CHANGED
|
@@ -965,13 +965,37 @@ const Map = ( { onMapClick, searchQuery, contentType, setSearchQuery, setSubmitt
|
|
| 965 |
type="range"
|
| 966 |
min="10"
|
| 967 |
max="10000"
|
| 968 |
-
step="1000"
|
| 969 |
value={explorationRadius}
|
| 970 |
onChange={(e) => setExplorationRadius(parseInt(e.target.value))}
|
| 971 |
style={{ width: '100%' }}
|
| 972 |
/>
|
| 973 |
-
<div style={{
|
| 974 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 975 |
</div>
|
| 976 |
</div>
|
| 977 |
|
|
|
|
| 965 |
type="range"
|
| 966 |
min="10"
|
| 967 |
max="10000"
|
|
|
|
| 968 |
value={explorationRadius}
|
| 969 |
onChange={(e) => setExplorationRadius(parseInt(e.target.value))}
|
| 970 |
style={{ width: '100%' }}
|
| 971 |
/>
|
| 972 |
+
<div style={{
|
| 973 |
+
display: 'flex',
|
| 974 |
+
alignItems: 'center',
|
| 975 |
+
gap: '8px',
|
| 976 |
+
marginTop: 4,
|
| 977 |
+
justifyContent: 'center'
|
| 978 |
+
}}>
|
| 979 |
+
<input
|
| 980 |
+
type="number"
|
| 981 |
+
min="10"
|
| 982 |
+
max="10000"
|
| 983 |
+
value={explorationRadius}
|
| 984 |
+
onChange={(e) => {
|
| 985 |
+
const value = parseInt(e.target.value);
|
| 986 |
+
if (value >= 10 && value <= 10000) {
|
| 987 |
+
setExplorationRadius(value);
|
| 988 |
+
}
|
| 989 |
+
}}
|
| 990 |
+
style={{
|
| 991 |
+
width: '80px',
|
| 992 |
+
padding: '4px 8px',
|
| 993 |
+
border: '1px solid #ccc',
|
| 994 |
+
borderRadius: '4px',
|
| 995 |
+
textAlign: 'center'
|
| 996 |
+
}}
|
| 997 |
+
/>
|
| 998 |
+
<span>m</span>
|
| 999 |
</div>
|
| 1000 |
</div>
|
| 1001 |
|