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

[BUG] add another back up server or change hosting server of maplibre style #3289

Closed
JinIgarashi opened this issue Apr 12, 2024 · 6 comments · Fixed by #3365
Closed

[BUG] add another back up server or change hosting server of maplibre style #3289

JinIgarashi opened this issue Apr 12, 2024 · 6 comments · Fixed by #3365
Assignees
Labels
bug Something isn't working

Comments

@JinIgarashi
Copy link
Contributor

JinIgarashi commented Apr 12, 2024

Bug Description

Currently, maplibre style used in GeoHub is managed as NPM package with versions, and it will be automatically synced with unpkg.com which is one of CDN server.

However, unpkg.com server is down today, and GeoHub become unavailable. As @iferencik is suggesting, to prevent such risk, we need to add back up server for maplibre style (I am not sure it is possible to do in maplibre) or switch unpkg.com to another alternative solution.

Bug Reproduction

https://unpkg.com/@undp-data/style@1.2.0/dist/sprite/sprite@4x.png

Bug Impact

No response

Bug Screenshots

No response

Bug References

No response

Bug System Information

  • OS: [e.g. Windows 10]
  • Browser: [e.g. Google Chrome, Firefox]

┆Issue is synchronized with this Wrike task by Unito

@JinIgarashi JinIgarashi added the bug Something isn't working label Apr 12, 2024
@JinIgarashi
Copy link
Contributor Author

maybe jsdelivr is better??

https://www.jsdelivr.com/package/npm/@undp-data/style?tab=files

@JinIgarashi
Copy link
Contributor Author

I though jsdelivr is at least more reliable than unpkg and at least can solve the issue that unpkg.com is down today, but I changed my mind and closed the PR for style repo because there will be the same problem occurred if jsdelivr is down. @iferencik thank you for giving me your valuable insights for the PR.

@JinIgarashi
Copy link
Contributor Author

JinIgarashi commented Apr 15, 2024

I don't think managing basemap styles in NPM with versioning is a bad implementation. we should keep NPM package to manage styles.
However, we can create new endpoints for basemap styles in GeoHub itself to import styles from NPM and return them to client.
Endpoint can be:

  • /basemap/style/{stylename}.json
    • returning style.json
    • stylename: either aerialstyle or style
  • /basemap/sprite/sprite{suffix}.{extension}
    • returning sprite (png or json) per resolution
    • suffix: optional. @2x or @4x or none
    • extension: json or png
  • /basemap/sprite-non-sdf/sprite{suffix}.{extension}
    • returning non-sdf sprite (png or json) per resolution
    • suffix: optional. @2x or @4x or none
    • extension: json or png

we also need to replace style JSON url and sprite URL style table in database and geohub's setting

@JinIgarashi
Copy link
Contributor Author

I am thinking
I can just copy style files and sprite files from NPM to /static folder of sveltekit other than creating new endpoints.

scripts property of package.json can be used to bring the style files before launching or building GeoHub. That can be easier, I think

@JinIgarashi
Copy link
Contributor Author

I included the latest style in dependencies via this PR #3332. but not yet changed style hosting

@JinIgarashi
Copy link
Contributor Author

I am going to change sprite path to relative path via UNDP-Data/style#38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants