Open rsalzer opened 5 months ago
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.
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 :-)
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. But for sources there's a bunch of code that I didn't understand...
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
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: