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

feat: add functionality to serve offline fallback map #450

Merged
merged 7 commits into from
Mar 12, 2024

Conversation

achou11
Copy link
Member

@achou11 achou11 commented Jan 29, 2024

Towards #439

Stacked on #435

Implements a fastify plugin for serving a fallback map in the case of not having an available local "default" static map or being offline. The plugin accepts required options for specifying where the style definition lives and the directory containing the geojson sources (this provides flexibility for consumers that may not necessarily be using something like mapeo-offline-map, or happen to change the filesystem structure).

TODO:

  • add documentation about the expected structure of the fallback map style definition and source files

@achou11 achou11 requested a review from gmaclennan January 29, 2024 23:35
@@ -88,6 +88,7 @@
"husky": "^8.0.0",
"light-my-request": "^5.10.0",
"lint-staged": "^14.0.1",
"mapeo-offline-map": "^2.0.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added as a dev dependency but if we want to be more strict about using this specifically, can change to direct or peer dep.

wasn't too keen on the offline map being bundled as of the npm package so i figured it would make sense to let the consumer decide to add the map as a dependency in its own project

@achou11 achou11 force-pushed the ac/offline-fallback-map branch from 35440ea to a18ecdc Compare January 30, 2024 18:15
@achou11 achou11 force-pushed the ac/serve-static-maps branch from f5be6af to 8aca6f8 Compare January 30, 2024 19:02
@achou11 achou11 force-pushed the ac/offline-fallback-map branch from a18ecdc to 2d75a01 Compare January 30, 2024 19:02
@achou11 achou11 force-pushed the ac/serve-static-maps branch from 8aca6f8 to 7412da8 Compare February 1, 2024 16:09
@achou11 achou11 force-pushed the ac/offline-fallback-map branch from d6f96b6 to 096e0d9 Compare February 1, 2024 16:10
@achou11 achou11 force-pushed the ac/serve-static-maps branch from 7412da8 to e563dce Compare February 5, 2024 16:51
@achou11 achou11 force-pushed the ac/offline-fallback-map branch from 096e0d9 to 3b6d2ce Compare February 5, 2024 16:52
@achou11 achou11 force-pushed the ac/serve-static-maps branch from e563dce to b4d8819 Compare February 8, 2024 21:37
@achou11 achou11 force-pushed the ac/offline-fallback-map branch from 3b6d2ce to e37954e Compare February 8, 2024 21:37
@achou11 achou11 force-pushed the ac/serve-static-maps branch from b4d8819 to 3e7668c Compare February 29, 2024 20:43
@achou11 achou11 force-pushed the ac/offline-fallback-map branch from e37954e to 8153ae9 Compare February 29, 2024 20:44
@achou11 achou11 requested a review from EvanHahn March 7, 2024 18:05
Copy link
Contributor

@EvanHahn EvanHahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than my annoying nitpicks.

src/fastify-plugins/utils.js Outdated Show resolved Hide resolved
src/fastify-plugins/utils.js Outdated Show resolved Hide resolved
tests/fastify-plugins/maps.js Show resolved Hide resolved
src/fastify-plugins/maps/offline-fallback-map.js Outdated Show resolved Hide resolved
src/fastify-plugins/maps/offline-fallback-map.js Outdated Show resolved Hide resolved
src/fastify-plugins/maps/offline-fallback-map.js Outdated Show resolved Hide resolved
src/fastify-plugins/maps/offline-fallback-map.js Outdated Show resolved Hide resolved
src/fastify-plugins/maps/offline-fallback-map.js Outdated Show resolved Hide resolved
@achou11 achou11 force-pushed the ac/serve-static-maps branch from 3e7668c to 773a3d6 Compare March 11, 2024 16:51
@achou11 achou11 force-pushed the ac/offline-fallback-map branch from 8153ae9 to ef363dd Compare March 11, 2024 16:51
@achou11 achou11 force-pushed the ac/serve-static-maps branch from 773a3d6 to 771f7df Compare March 12, 2024 18:08
@achou11 achou11 force-pushed the ac/offline-fallback-map branch from ef363dd to af62ed3 Compare March 12, 2024 18:08
Base automatically changed from ac/serve-static-maps to main March 12, 2024 18:13
@achou11 achou11 force-pushed the ac/offline-fallback-map branch from af62ed3 to be88383 Compare March 12, 2024 18:15
@achou11 achou11 merged commit 15c551d into main Mar 12, 2024
4 checks passed
@achou11 achou11 deleted the ac/offline-fallback-map branch March 12, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants