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: Fetch style from url #1462

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

YoelRidgway
Copy link

@YoelRidgway YoelRidgway commented Feb 10, 2025

This PR adds the ability to fetch remote JSON stylesheets by specifying a url in the config.

For example:

"styles": {
    "streets-v2": {
      "style": "https://api.maptiler.com/maps/streets-v2/style.json?key=********************",
      "tilejson": {
        "type": "overlay"
      }
    },
    "maplibre-demotiles": {
       "style": "https://demotiles.maplibre.org/style.json"
    }
}

Resolves #1460

let styleJSON;
try {
if (isValidHttpUrl(item.style)) {
const res = await fetch(item.style);

Check warning

Code scanning / CodeQL

File data in outbound network request Medium

Outbound network request depends on
file data
.
@YoelRidgway YoelRidgway marked this pull request as ready for review February 10, 2025 17:34
@YoelRidgway YoelRidgway changed the title Fetch style from url feat: Fetch style from url Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Feature to fetch style.json from a url
1 participant