j40-cejst-2/docs/decisions/0007-maplibre.md
Nat Hillard 4443f60b44
Adding ADR for using maplibre to repo (see issue #299) (#325)
* Adding ADR for using maplibre to repo (see issue #299)
2021-07-12 18:11:56 -04:00

2.7 KiB

Use MapLibre for Map Visualization

Context and Problem Statement

Styling a map with a large number of features, in a performant way, is difficult. With 200,000+ block groups, our project needs this performance for a smooth user experience. Our current mapping approach, using OpenLayers, is insufficient for this task. We propose switching to MapLibre as a free and open source way to improve the performance and user experience of our map.

Decision Drivers

  • Free and Open Source
  • Good performance in rendering a large number of features
  • Good performance in zooming and panning
  • Easy map styling

Considered Options

  • MapLibre GL JS 1.15.0
  • Mapbox GL JS 2.3.1
  • Mapbox GL JS 1.13.0
  • OpenLayers 6.4.3

Decision Outcome

Chosen option: MapLibre 1.15.0, a free and open-source library with good performance and standard map styling capabilities, and continued development lifecycle.

Positive Consequences

  • MapLibre is free and open source
  • Performance is preferable to OpenLayers, as seen in this video: MapLibre Performance
  • MapLibre is under continued development

Negative Consequences

  • The MapLibre project is still relatively new
    • Mitigation: if we need to revert we can go back to Mapbox 1.13.0
  • We need to change variable and class names to change "mapbox" references to "maplibre"
    • Mitigation: this is a relatively small change
  • There might be other incompatibilities with mapbox and/or backwards incompatibilities as the Maplibre framework evolves
    • Mitigation: we will follow the progress of MapLibre as it evolves

Pros and Cons of the Options

Mapbox-GL JS 2.3.1

The latest released version of Mapbox

  • Pro: performance is quite good and improving
  • Con: as of December of last year, Mapbox has moved to a proprietary license
  • Con: requires key, payment, even for self-hosted version and tiles

Mapbox-GL JS 1.13.0

The last pre-license change version of Mapbox

  • Pro: Perf still good
  • Pro: License permissive, no required key
  • Con: Not under current active development

OpenLayers 6.4.3

This option is sticking with our current choice, the latest released version of the OpenLayers, an alternative open source framework.

  • Pro: No change necessary vs. current setup
  • Con: Without WebGL support, performance is inferior to these other options