Context
The Directus CMS manages POIs with geometry fields displayed via the built-in map interface. Currently, users must manually draw geometry on the map. Many users have GPX files from GPS devices or route planners that they want to import as POI geometry.
A Ruby migration script already exists at db/migrate/20260176014838_gpx_to_geom.rb that converts GPX → GeoJSON (LineString/MultiLineString), but this is a one-time migration, not a user-facing tool.
Goal
Build a Directus interface extension (directus-extension-map-gpx) that wraps the built-in map interface for geometry fields, adding GPX file upload capability while preserving all existing map features (drawing, editing).
Features
- Wraps built-in
interface-map — reuses MapLibre GL + Mapbox Draw for full geometry drawing/editing
- GPX upload zone (drag & drop / file input) below the map
- Client-side GPX parsing using browser DOMParser (no server dependency)
- Prefers
<trk>/<trkseg>/<trkpt> (GPS traces) over <rte>/<rtept> (waypoints)
- Removes consecutive duplicate points
- Merges contiguous linestrings
- Returns GeoJSON
LineString or MultiLineString
- Error handling for invalid GPX files (using Directus
<v-notice>)
- No extra map dependency — only bundles the GPX parser logic
Acceptance criteria
Context
The Directus CMS manages POIs with geometry fields displayed via the built-in
mapinterface. Currently, users must manually draw geometry on the map. Many users have GPX files from GPS devices or route planners that they want to import as POI geometry.A Ruby migration script already exists at
db/migrate/20260176014838_gpx_to_geom.rbthat converts GPX → GeoJSON (LineString/MultiLineString), but this is a one-time migration, not a user-facing tool.Goal
Build a Directus interface extension (
directus-extension-map-gpx) that wraps the built-in map interface for geometry fields, adding GPX file upload capability while preserving all existing map features (drawing, editing).Features
interface-map— reuses MapLibre GL + Mapbox Draw for full geometry drawing/editing<trk>/<trkseg>/<trkpt>(GPS traces) over<rte>/<rtept>(waypoints)LineStringorMultiLineString<v-notice>)Acceptance criteria