-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
Comments
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. |
The code around replacing the access token is weird, and potentially buggy, or does not expect this flow. Bottom line, more of a feature than a bug :-) |
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. |
It works for glyphs and maybe sprites I believe. |
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 |
Yes, the glyphs, sprite and source URLs can be added as a full address including the access token and avoid all this complexity... |
@HarelM , I realized it's maybe not great to only have the api keys in urls.. if you have a style locally with urls containing {key} and upload that to maputnik, it's necessary that Maputnik can insert the tokens, rather than expect some server to do it. Examples being: |
Ahh, I see... I don't have a good idea how to solve this from the top of my head, it might require more thought to think about a proper UX to solve this on one hand and easier maintenance on the other... |
Going from e.g. MapTiler to OpenLayers and back will lose the maptlier key. This code finds the urls in the style that has "{key}" and insert the correct API keys Fixes the error reported here, cc @nyurik - Fixes #874 (comment) Related to: - #869 ## Launch Checklist <!-- Thanks for the PR! Feel free to add or remove items from the checklist. --> - [ ] Briefly describe the changes in this PR. - [ ] Link to related issues. - [ ] Include before/after visuals or gifs if this PR includes visual changes. - [ ] Write tests for all new functionality. - [ ] Add an entry to `CHANGELOG.md` under the `## main` section.
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:
style.json
The text was updated successfully, but these errors were encountered: