maplibre-react-native
maplibre-react-native copied to clipboard
Implement transformRequest similar to maplibre-gl-js
@tenhtof but we don't have transformRequest props for MapView component
Originally posted by @dsardar099 in https://github.com/maplibre/maplibre-react-native/issues/415#issuecomment-2231063304
It'd be great if this can include transformStyle as well if and when someone decides to tackle it!
For reference, this recent PR in maplibre-gl-js fixed transformStyle so that it could be used to resolve (among other things) the ESRI relative URLs problem (i.e. #554, #51 ).
Any update for this?
To connect to my TileServer GL, I had to use a proxy to convert a URL encoded token into a header token, as a workaround. But would be great to be able to alter the request so I can add a header without needing a proxy server for it. Since this work around is quite expensive.
@edurenye, I believe you can address this usecase with addCustomHeader.
Thank you very much @tyrauber !
I've been running into this same issue (with Esri TileJSON being non spec compliant), and I'd like to contribute this feature (though I'm not sure I'd be able to).
Some questions for the maintainers:
- Would this require changes upstream in maplibre-native? It seems to me like it would, as this library doesn't handle the requests.
- If upstream changes are needed, how do y'all coordinate that work across multiple projects? It seems like there's a desire for this feature over there as well, but the issue is stale and hasn't had any maintainer input.
MLRN is only a wrapper around MLN. So if something is not possible within MLN, MLRN can't solve it. I don't fully understand the limitations over in https://github.com/maplibre/maplibre-native/issues/126, but one would have to try, if this could be used to implement the desired feature. If not, you can try to implement it within MLN, then adopting it here for MLRN.
My personal opinion: Instead of spending time on implementing this, make your styles spec compliant.
@KiwiKilian I agree wholeheartedly! However, I and other Esri users don't control what their API returns. I have let them know about the issue, but it's been known since at least 2021 so IDK if anything will come of it.
I think the approach outlined in https://github.com/maplibre/maplibre-native/issues/126 won't support the transformRequest feature of maplibre-gl-js as it won't have context about what type of request it is.