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

@@ -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

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
Base automatically changed from ac/serve-static-maps to main March 12, 2024 18:13
@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