map view (Leaflet + OSM), iOS switches, Alarm → Benachrichtigungen
* flats: new lat/lng columns (migration v3); alert geocodes every new flat through googlemaps and ships coords in the payload * web: CSP extended for unpkg (leaflet.css) + tile.openstreetmap.org * Wohnungen tab: Liste/Karte view toggle (segmented, CSS-only via :has(), selection persisted in localStorage). Karte shows passende flats as Pins on an OSM tile map; Popup per Pin mit Adresse, Zimmer/m²/€ und Link * Top-strip toggles are now proper iOS-style toggle switches (single rounded knob sliding in a pill, red when on), no descriptive subtitle * Alarm-Karte verlinkt jetzt auf /einstellungen/benachrichtigungen (Filter-Karte bleibt /einstellungen/filter) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d9468f6814
commit
376551213a
8 changed files with 239 additions and 83 deletions
|
|
@ -23,6 +23,20 @@ class Maps:
|
|||
def __init__(self):
|
||||
self.gmaps = googlemaps.Client(key=GMAPS_API_KEY)
|
||||
|
||||
def geocode(self, address):
|
||||
"""Return (lat, lng) or None for a Berlin address string."""
|
||||
if not address:
|
||||
return None
|
||||
try:
|
||||
res = self.gmaps.geocode(f"{address}, Berlin, Germany")
|
||||
if not res:
|
||||
return None
|
||||
loc = res[0]["geometry"]["location"]
|
||||
return (float(loc["lat"]), float(loc["lng"]))
|
||||
except Exception as e:
|
||||
logger.warning("geocode failed for %r: %s", address, e)
|
||||
return None
|
||||
|
||||
def _get_next_weekday(self, date, weekday):
|
||||
days_ahead = weekday - date.weekday()
|
||||
if days_ahead <= 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue