mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

Support setting custom HTTP headers before Map initialization

Open Taharu opened this issue 1 month ago • 0 comments

We can set custom HTTP headers via setCustomHeaders(...), but we can only do that inside the onMapCreated callback (after obtaining the MapboxMap instance). However, this timing is too late: the initial network requests (style / glyph / sprite / tile) are already fired before setCustomHeaders done, so those first requests never include our custom headers.

We’d like to define custom headers before any Maps API object is constructed — similar to how we set the access token with MapboxOptions.setAccessToken(...).

Rationale

Some servers require custom auth headers for all map traffic

Enterprise / B2B applications often need to identify the app / org via headers

Prevents the “first request goes out without headers” problem

Thanks!

Taharu avatar Nov 06 '25 06:11 Taharu