feat(map): right-click place dossier (Nominatim + nearby overlays)
Right-click (long-press on touch) opens a What's here? HUD panel: reverse geocode via GET /api/place (honest UA, 1 req/s, 60s/500-key cache) and lists already-loaded cameras, aircraft, vessels, fires, and alerts within 5 km.
This commit is contained in:
parent
c48788d4b6
commit
5cef596a3c
7 changed files with 566 additions and 6 deletions
20
app/main.py
20
app/main.py
|
|
@ -59,6 +59,7 @@ from live_layers import (
|
|||
fetch_storms, fetch_trains, fetch_vessels, fetch_weather_alerts,
|
||||
overlay_catalog, parse_bbox, UpstreamRateLimited,
|
||||
)
|
||||
from place import reverse_geocode
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = structlog.get_logger("osint.dashboard")
|
||||
|
|
@ -1729,6 +1730,25 @@ async def list_storms():
|
|||
_upstream_or_502(exc, "storms")
|
||||
|
||||
|
||||
@app.get("/api/place")
|
||||
async def get_place(
|
||||
lat: float = Query(..., ge=-90, le=90),
|
||||
lon: float = Query(..., ge=-180, le=180),
|
||||
):
|
||||
"""Nominatim reverse geocode for the map \"What's here?\" dossier.
|
||||
|
||||
Identifying ``OSINT_USER_AGENT``, 1 req/s, 60s cache, 500 keys. The HUD
|
||||
lists already-loaded overlay entities client-side — this route does not
|
||||
refetch aircraft/vessels/cameras/fires.
|
||||
"""
|
||||
try:
|
||||
return overlay_json(await reverse_geocode(lat, lon), 60)
|
||||
except ValueError as exc:
|
||||
raise HTTPException(422, str(exc)) from exc
|
||||
except Exception as exc:
|
||||
_upstream_or_502(exc, "nominatim")
|
||||
|
||||
|
||||
_GPSJAM_DATE = re.compile(r"^\d{4}-\d{2}-\d{2}$")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue