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

Add OSM OpenMapTiles to style gallery list #949

Closed
bolollo opened this issue Oct 24, 2024 · 2 comments · Fixed by #956
Closed

Add OSM OpenMapTiles to style gallery list #949

bolollo opened this issue Oct 24, 2024 · 2 comments · Fixed by #956

Comments

@bolollo
Copy link
Contributor

bolollo commented Oct 24, 2024

Add the https://openmaptiles.org/styles/#osm-openmaptiles to the gallery.

This style simulates the traditional OSM style.

I recently saw that a style with an API key is included in the gallery style list, such as

"url": "https://api.protomaps.com/styles/v2/light.json?key=d828297496b11844",
.

In this case, the OSM OMT style would be loaded from https://api.maptiler.com/maps/openstreetmap/style.json?key=YOUR_MAPTILER_API_KEY_HERE (using the API key we have enabled for MapLibre:

"openmaptiles": "get_your_own_OpIi9ZULNHzrESv6T2vL",
).

I can prepare the PR, but I have a couple of questions:

Do I put the key hard-coded with the style, or is there another way to do it?

Do I have to upload the thumbnail to https://maputnik.github.io/thumbnails, or can it be an external URL like https://openmaptiles.org/img/styles/openmaptiles.png?

@roblabs
Copy link
Contributor

roblabs commented Nov 7, 2024

In this case, I recommend submitting a PR with an access token that is restricted to both of the domains localhost and maplibre.org. Check with your tile server provider to see if they support domain restriction or domain origin.

The current version of Maputnik has references on how to do Domain or Origin restriction.


The ProtoMaps.io style that you reference looks like it's keyed to work servers that are either localhost or maplibre.org

That is, when I click on the link, the server replies with the following,

Invalid origin for API key

The Protomap Light style works off these servers:

but not when I reference the Protomap Light style from either of these cases, it fails. Which seems to be the intention

@bolollo
Copy link
Contributor Author

bolollo commented Nov 14, 2024

Thanks @roblabs

PR done: #956

The API key already has maplibre.org as the allowed origin, so it should work without any issues.

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 a pull request may close this issue.

2 participants