Context & Motivation
Currently, fdm-app uses react-map-gl with mapbox-gl and Mapbox services. However, Mapbox does not support Cloud Optimized GeoTIFFs (COG), a critical feature for our roadmap. Furthermore, we have observed that MapLibre offers more innovation relevant to our needs, particularly in the open-source domain, compared to the current direction of Mapbox. To align with these requirements, open-source principles, and improve maintainability, we are migrating to maplibre-gl.
We are replacing Mapbox services with a flexible configuration that supports:
- MapTiler (Preferred for performance/reliability).
- Pure Open Source / Free Tier (OSM + Esri World Imagery + Nominatim).
Scope
- Rendering Engine:
mapbox-gl -> maplibre-gl.
- Basemaps:
- Option A (MapTiler): Satellite Hybrid.
- Option B (Open): OpenStreetMap (Standard) & Esri World Imagery (Satellite).
- Geocoding:
- Option A (MapTiler): MapTiler Geocoding.
- Option B (Open): Nominatim (OSM).
Technical Requirements
1. Dependencies
- Remove:
mapbox-gl, @types/mapbox-gl, @mapbox/mapbox-gl-geocoder, @types/mapbox__mapbox-gl-geocoder.
- Install:
maplibre-gl, @types/maplibre-gl.
@maplibre/maplibre-gl-geocoder (Community fork, supports Nominatim & MapTiler via adapter).
2. Environment Configuration
- New Variable:
MAP_PROVIDER (maptiler | osm).
- New Variable:
MAPTILER_API_KEY (Required if provider is maptiler).
- Update:
fdm-app/app/integrations/mapbox.ts -> integrations/map.ts.
- Export
getMapStyle(provider): Returns style JSON.
- MapTiler: URL to standard MapTiler style.
- OSM/Esri: A locally constructed MapLibre Style JSON object defining
raster sources for OSM or Esri.
3. Component Refactoring
atlas-controls.tsx:
- Switch to generic
react-map-gl controls.
atlas-geocoder.tsx:
- Implement
@maplibre/maplibre-gl-geocoder.
- Configure the
geocodingApi based on MAP_PROVIDER.
- If
maptiler: Use MapTiler API.
- If
osm: Use Nominatim API.
atlas-sources.tsx & atlas-styles.tsx:
- Update types to
maplibre-gl.
4. Route Updates
- Map Instances:
- Update
<Map> components to use mapLib={import('maplibre-gl')}.
Acceptance Criteria
- Basemap:
- Configured provider loads (MapTiler Hybrid OR Esri Satellite).
- Search:
- Geocoding returns results from the configured provider.
- Field Selection: Existing FlatGeobuf functionality remains operational.
- Clean Code: No
mapbox imports remain.
Task List
Context & Motivation
Currently,
fdm-appusesreact-map-glwithmapbox-gland Mapbox services. However, Mapbox does not support Cloud Optimized GeoTIFFs (COG), a critical feature for our roadmap. Furthermore, we have observed that MapLibre offers more innovation relevant to our needs, particularly in the open-source domain, compared to the current direction of Mapbox. To align with these requirements, open-source principles, and improve maintainability, we are migrating tomaplibre-gl.We are replacing Mapbox services with a flexible configuration that supports:
Scope
mapbox-gl->maplibre-gl.Technical Requirements
1. Dependencies
mapbox-gl,@types/mapbox-gl,@mapbox/mapbox-gl-geocoder,@types/mapbox__mapbox-gl-geocoder.maplibre-gl,@types/maplibre-gl.@maplibre/maplibre-gl-geocoder(Community fork, supports Nominatim & MapTiler via adapter).2. Environment Configuration
MAP_PROVIDER(maptiler|osm).MAPTILER_API_KEY(Required if provider ismaptiler).fdm-app/app/integrations/mapbox.ts->integrations/map.ts.getMapStyle(provider): Returns style JSON.rastersources for OSM or Esri.3. Component Refactoring
atlas-controls.tsx:react-map-glcontrols.atlas-geocoder.tsx:@maplibre/maplibre-gl-geocoder.geocodingApibased onMAP_PROVIDER.maptiler: Use MapTiler API.osm: Use Nominatim API.atlas-sources.tsx&atlas-styles.tsx:maplibre-gl.4. Route Updates
<Map>components to usemapLib={import('maplibre-gl')}.Acceptance Criteria
mapboximports remain.Task List
integrations/map.tswith configurable style generator (MapTiler/Esri/OSM).atlas-geocoder.tsxto use@maplibre/maplibre-gl-geocoderwith provider switch.maplibre-gl.