This project is a basic Point of Interest (POI) editor built with Angular, TypeScript, and MapLibre GL JS.
Users can load POIs from a GeoJSON file, visualize them on a map, add new points by clicking, edit or delete existing points, and persist/export the data locally.
- Display base map using MapLibre (Carto Positron style).
- Import GeoJSON.
- Invalid features are discarded (invalid geometry, missing properties, etc.).
- Summary of imported vs discarded is displayed.
- Add new points by clicking on the map.
- Edit
nameandcategoryof existing points. - Delete points.
- Persist data to
localStorageand auto-restore. - Export POIs as
.geojsonfile. - Clear local state.
Clone this repository and install dependencies:
git clone <your-repo-url>
cd poi-editor
npm installTo start a local development server, run:
ng serveOnce the server is running, open your browser and navigate to http://localhost:4200/.
- Component separation:
AppComponent→ handles data, file import/export, persistence.MapViewComponent→ encapsulates MapLibre logic and emits events.GeojsonService→ validation logic for imported GeoJSON.
- MapLibre: chosen for rendering due to being lightweight and API-key free.
- Persistence: localStorage (simple, no backend required).
- Popup editing: implemented with browser
prompt()to keep UI minimal and within MVP scope.
Trade-offs:
- Simplicity vs. UX: using
prompt()instead of a custom form makes the UX less polished but kept development time within scope. - Replacing features on file import (instead of merging) ensures a clean, predictable state.
- LocalStorage is easy but limited; in real scenarios a backend database or cloud persistence would be required.
- Import replaces existing points instead of merging (by design, but could be extended).
- Minimal UI (no advanced design).
- No unit tests.
- Error handling is basic (alerts/logs).
Potential improvements:
- Add a proper edit modal instead of
prompt(). - Support merging imported data with existing features.
- Unit tests for validators.