-
Hi there! We're using a secured endpoint for our map style, which requires authentication via an API key.
Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ErwanJes, unfortunately there is currently no built-in solution to modify the request headers. In the MapLibre android SDK I think you would normally do this by setting a custom In case you are able to change the tile server, many public tile server providers use a A workaround solution could be to fetch the style in Flutter and provide MapLibre with the downloaded JSON. Let me know about solution you prefer and want to go with. 😄 |
Beta Was this translation helpful? Give feedback.
Hi @ErwanJes,
unfortunately there is currently no built-in solution to modify the request headers. In the MapLibre android SDK I think you would normally do this by setting a custom
OkHttpClient
that has a request interceptor (see the docs).In case you are able to change the tile server, many public tile server providers use a
key
query parameter for authentication instead of an authentication header:https://my-tile-server.example/style.json?key=token
. The same principle would then be used for the various tile sources in the style.A workaround solution could be to fetch the style in Flutter and provide MapLibre with the downloaded JSON.
Let me know about solution you prefer and want to…