Skip to content

CarlaHayler/map

Repository files navigation

POI Editor

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.

Features (MVP)

  • 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 name and category of existing points.
  • Delete points.
  • Persist data to localStorage and auto-restore.
  • Export POIs as .geojson file.
  • Clear local state.

Installation and run

Clone this repository and install dependencies:

git clone <your-repo-url>
cd poi-editor
npm install

To start a local development server, run:

ng serve

Once the server is running, open your browser and navigate to http://localhost:4200/.

Architecture and trade-offs

  • 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.

Known limitations and possible improvements

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors