(delta: number)
| 268 | }, [challenge, config, selectedCenter]); |
| 269 | |
| 270 | function zoomBy(delta: number) { |
| 271 | const holder = mapRef.current; |
| 272 | if (!holder) return; |
| 273 | const { map } = holder; |
| 274 | const nextZoom = Math.max(3, Math.min(20, map.getZoom() + delta)); |
| 275 | map.setZoom(nextZoom); |
| 276 | setZoom(nextZoom); |
| 277 | } |
| 278 | |
| 279 | useEffect(() => { |
| 280 | const holder = mapRef.current; |