[Feature]: Map pin layers, with per-layer export and import
Author: chriscrosstalkCreated Sep 28, 2026Updated Sep 28, 2026
Labelsenhancement
Summary
Let users organize map pins into layers, toggle which layers are visible, and export or import pins one layer at a time so they can be moved between Project NOMAD instances.
Why
Pins currently live in one flat list in the database of the box where they were created. There is no way to:
- Keep different sets of pins separate (for example "Water sources", "Rally points", "Trip: Moab 2026")
- Show only the pins that matter right now
- Move pins to new hardware, keep a home server and a portable build in sync, or share a set of locations with family or a group
Proposed behavior
Layers
- Every pin belongs to exactly one layer. On upgrade, existing pins go into a default layer (e.g. "My Pins"), so nothing changes for current users until they create a second layer.
- A layers panel in the Maps UI lists each layer with a visibility checkbox, plus create / rename / delete.
- When a pin is created it goes into the currently selected layer.
- A route and all its points stay in one layer together.
- Deleting a layer deletes its pins (with confirmation).
Export
- Export a single layer or all layers to a file.
- First format: a versioned NOMAD JSON file that keeps every field exactly as-is, including the layer name, pin styling, notes, and route membership and order.
- Built so more formats can be added later. GeoJSON and GPX are planned follow-ups for other map apps and GPS devices.
Import
When importing a NOMAD JSON file, the user chooses one of:
- Add as a new layer (default): creates a new layer named from the file. It never touches existing pins.
- Merge into an existing layer: pick a layer; the imported pins are added to it.
- Replace an existing layer: pick a layer; its pins are removed, then the import is written. Requires confirmation. Only that layer is affected.
Show a short summary afterward (for example, "Imported 42 pins and 3 routes into 'Rally points'").
Implementation notes
- Existing CRUD lives at
/api/maps/markers. Routes are stored as markers withroute_id/route_order, so exports must keep route grouping and order intact. - "Layer" already refers to MapLibre style layers in
map_service.ts. Use a distinct name in code and schema (e.g.marker_layers) to avoid confusion. - The per-pin
visibleflag stays. A pin shows only if both it and its layer are visible. - The file includes a
format_versionso older exports still import after schema changes. - On import, assign new route IDs so imported routes can't collide with existing ones.
- Treat the file as untrusted input: validate coordinate ranges, field types and lengths, and cap file size and pin count.
- Merge: skip exact duplicates (same name and coordinates) so importing the same file twice doesn't double every pin.
Out of scope (for now)
- GeoJSON / GPX export and import (follow-up once the NOMAD format ships)
- Moving a pin to a different layer (planned follow-up)
- Automatic sync between instances
- A pin belonging to more than one layer
Source: Crosstalk-Solutions/project-nomad