Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Map] Use MapLibre for offline environment #882

Closed
6 tasks
rudokemper opened this issue Nov 12, 2022 · 0 comments · Fixed by #943
Closed
6 tasks

[Map] Use MapLibre for offline environment #882

rudokemper opened this issue Nov 12, 2022 · 0 comments · Fixed by #943
Assignees

Comments

@rudokemper
Copy link
Member

rudokemper commented Nov 12, 2022

Just scoping out some eventual work to use MapLibre for the offline environment / profile.

I created a Ruby gem maplibre-gl-rails and tested it with Terrastories to make sure that it works, across all areas of the app. (Currently, the map library is piped from Rails to React to serve the map on the front end, as well as the different map views in the Rails CMS.)

To use maplibre-gl-rails instead of mapbox-gl-rails for offline maps, we will have to do the following. This is assuming implementation prior to any Rails / React refactor work in the future.

  • Add maplibre-gl-rails to the Rails Gemfile.
    • Can we selectively include either mapbox-gl-rails or maplibre-gl-rails in the Gemfile depending on Docker profile? A nice-to-have to keep filesize down.
  • In Map.jsx: if offline environment is detected, then use MapLibre functions instead of Mapbox functions. Maybe using useLocalMapServer or a smarter way per the Rails environment.
  • Implement a similar change across the Rails CMS, specifically in the show dashboards for Places and Stories, and the edit dashboard for Themes.
  • Import maplibre-gl instead of mapbox-gl for all of the SCSS assets.
  • Deactivate mapProjection (since that has not been implemented for MapLibre yet).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment