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

MapTiler Access Token does not get added to URLs #869

Open
rsalzer opened this issue Jan 30, 2024 · 5 comments
Open

MapTiler Access Token does not get added to URLs #869

rsalzer opened this issue Jan 30, 2024 · 5 comments

Comments

@rsalzer
Copy link

rsalzer commented Jan 30, 2024

I tried to use a JSON style in which MapTiler-Datasource are used. I left all the key={key} in there in order for Maputnik to replace it when I add it in the "Style Setting".

Unfortunately it does not apply them.

Steps to reproduce:

  • Open this file in Maputnik (Open --> Upload):
    style.json
  • Add a MapTiler Access Token to the "Style Settings"
image
@HarelM
Copy link
Collaborator

HarelM commented Jan 30, 2024

I would say that I hoped maptiler would be inclined to fix this, but they have their editor, so I'm not sure any help would come from there.
Having said that, maputnik codebase is small and you should be able to find and fix this issue.

@HarelM
Copy link
Collaborator

HarelM commented Jan 31, 2024

The code around replacing the access token is weird, and potentially buggy, or does not expect this flow.
Since the keys should be part of the style, I believe you should simply set them in the relevant source and not expect maputnik to replace it.

Bottom line, more of a feature than a bug :-)

@rsalzer
Copy link
Author

rsalzer commented Jan 31, 2024

Then the bottom line would be to remove those fields which suggest that it works ;)

A better flow would probably be to offer values which maputnik replaces ... {key} or {maptilerKey} and then replaces them everywhere.

@HarelM
Copy link
Collaborator

HarelM commented Jan 31, 2024

It works for glyphs and maybe sprites I believe.
But for sources there's a bunch of code that I didn't understand...

@rsalzer
Copy link
Author

rsalzer commented Feb 18, 2024

Probably it would be quite easy to add a possibility to add variables (in the shape of {variable}) which then can get replaced. Like this it would be universal ... I might add a PR

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

No branches or pull requests

2 participants