Sprint 6: Karte / Orte / Routen mit GPS-Aufzeichnung
- backend/routes/places.py: CRUD für hundefreundliche Orte (6 Typen) - backend/routes/routen.py: CRUD für Gassi-Routen mit GPS-Track (JSON) - main.py: beide Router eingehängt (/api/places, /api/routes) - api.js: places + routes erweitert (list, update, delete) - pages/places.js: Karte + Liste, Typ-Filter, Ort anlegen/bearbeiten - pages/routes.js: Routen entdecken + GPS-Aufzeichnung mit Stoppuhr - pages/map.js: zentrale Übersichtskarte (Orte + Giftköder, Layer-Toggle) - components.css: Styles für alle drei neuen Seiten - sw.js: by-v19 → by-v20
This commit is contained in:
parent
956e34db88
commit
b9df636535
9 changed files with 1948 additions and 9 deletions
|
|
@ -160,26 +160,34 @@ const API = (() => {
|
|||
// KARTE & ORTE
|
||||
// ----------------------------------------------------------
|
||||
const places = {
|
||||
listNearby(lat, lon, type = null, radius = 3000) {
|
||||
list(typ = null) {
|
||||
return get(`/places${typ ? '?typ=' + encodeURIComponent(typ) : ''}`);
|
||||
},
|
||||
listNearby(lat, lon, typ = null, radius = 5000) {
|
||||
const params = new URLSearchParams({ lat, lon, radius });
|
||||
if (type) params.set('type', type);
|
||||
if (typ) params.set('typ', typ);
|
||||
return get(`/places?${params}`);
|
||||
},
|
||||
get(id) { return get(`/places/${id}`); },
|
||||
create(data) { return post('/places', data); },
|
||||
rate(id, rating, comment) { return post(`/places/${id}/ratings`, { rating, comment }); },
|
||||
get(id) { return get(`/places/${id}`); },
|
||||
create(data) { return post('/places', data); },
|
||||
update(id, data) { return patch(`/places/${id}`, data); },
|
||||
delete(id) { return del(`/places/${id}`); },
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// GASSI-ROUTEN
|
||||
// ----------------------------------------------------------
|
||||
const routes = {
|
||||
list() {
|
||||
return get('/routes');
|
||||
},
|
||||
listNearby(lat, lon, radius = 10000) {
|
||||
return get(`/routes?lat=${lat}&lon=${lon}&radius=${radius}`);
|
||||
},
|
||||
get(id) { return get(`/routes/${id}`); },
|
||||
create(data) { return post('/routes', data); },
|
||||
rate(id, d) { return post(`/routes/${id}/ratings`, d); },
|
||||
get(id) { return get(`/routes/${id}`); },
|
||||
create(data) { return post('/routes', data); },
|
||||
update(id, data) { return patch(`/routes/${id}`, data); },
|
||||
delete(id) { return del(`/routes/${id}`); },
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue