Compare commits

...

2 Commits

Author SHA1 Message Date
361a826e4f Improve nearby search
* Use regular expression queries for place types
* Add more place types
* Add relations
* Only return results with a name
2026-02-24 09:58:12 +04:00
ff01d54fdd Update status doc 2026-02-23 23:28:11 +04:00
3 changed files with 37 additions and 7 deletions

View File

@@ -36,6 +36,9 @@ We are building **Marco**, a decentralized maps application using **Ember.js** (
- **Persistence:** Saves and restores map center and zoom level using `localStorage` (key: `marco:map-view`). - **Persistence:** Saves and restores map center and zoom level using `localStorage` (key: `marco:map-view`).
- **Controls:** Enabled standard OpenLayers Rotate control (re-north) and custom Locate control. - **Controls:** Enabled standard OpenLayers Rotate control (re-north) and custom Locate control.
- **Pin Animation:** Selected pins are highlighted with a custom **Red Pin** overlay that drops in with an animation. The center dot is styled as a solid dark red circle (`#b31412`). - **Pin Animation:** Selected pins are highlighted with a custom **Red Pin** overlay that drops in with an animation. The center dot is styled as a solid dark red circle (`#b31412`).
- **Smart Zoom:** Implemented `zoomToBbox` to automatically fit complex geometries (ways/relations) within the visible viewport.
- **Dynamic Padding:** Calculates padding based on active UI elements (Sidebar on Desktop, Bottom Sheet on Mobile) to ensure the geometry is perfectly centered in the _visible_ map area.
- **Data Processing:** `OsmService` now calculates bounding boxes for ways and relations by aggregating member node coordinates.
### 2. RemoteStorage Module (`@remotestorage/module-places`) ### 2. RemoteStorage Module (`@remotestorage/module-places`)
@@ -103,6 +106,16 @@ We are building **Marco**, a decentralized maps application using **Ember.js** (
- Responsive crosshair sizing (48px desktop / 24px mobile). - Responsive crosshair sizing (48px desktop / 24px mobile).
- **Persistence:** Form data (Title, Description) and Map coordinates are securely saved to RemoteStorage via `storage.storePlace`. - **Persistence:** Form data (Title, Description) and Map coordinates are securely saved to RemoteStorage via `storage.storePlace`.
### 6. Search Functionality
- **Provider:** Integrated **Photon API** (by Komoot) via `app/services/photon.js` for high-quality, typo-tolerant OpenStreetMap search.
- **UI:** `SearchBoxComponent` implements a responsive search bar with instant autocomplete.
- **Debounced Input:** 300ms delay to prevent excessive API calls.
- **Location Bias:** Automatically biases search results towards the current map center to show relevant local places first.
- **Direct Navigation:** Selecting a result with a valid OSM ID navigates directly to the specific place details (`/place/osm:type:id`).
- **Resilience:** Implemented retry logic (exponential backoff/fixed delay) for network errors and rate limits (429).
- **Data Normalization:** Search results are normalized to match the internal POI schema, ensuring consistent rendering across Search and Map views.
## Current State ## Current State
- **Repo:** The app runs via `pnpm start`. - **Repo:** The app runs via `pnpm start`.

View File

@@ -24,14 +24,31 @@ export default class OsmService extends Service {
this.controller = new AbortController(); this.controller = new AbortController();
const signal = this.controller.signal; const signal = this.controller.signal;
const typeKeys = [
'amenity',
'amenity',
'shop',
'tourism',
'historic',
'leisure',
'office',
'craft',
'building',
'landuse',
'public_transport',
'aeroway'
]
const typeKeysQuery = [`~"^(${typeKeys.join("|")})$"~".*"`];
const query = ` const query = `
[out:json][timeout:25]; [out:json][timeout:25];
( (
nw["amenity"](around:${radius},${lat},${lon}); node(around:${radius},${lat},${lon})
nw["shop"](around:${radius},${lat},${lon}); [${typeKeysQuery}][name~"."];
nw["tourism"](around:${radius},${lat},${lon}); way(around:${radius},${lat},${lon})
nw["leisure"](around:${radius},${lat},${lon}); [${typeKeysQuery}][name~"."];
nw["historic"](around:${radius},${lat},${lon}); relation(around:${radius},${lat},${lon})
[${typeKeysQuery}][name~"."];
); );
out center; out center;
`.trim(); `.trim();