maplibre-react-native icon indicating copy to clipboard operation
maplibre-react-native copied to clipboard

Implement transformRequest similar to maplibre-gl-js

Open dsardar099 opened this issue 1 year ago • 9 comments
trafficstars

Implement transformRequest similar to maplibre-gl-js.

dsardar099 avatar Jul 16 '24 14:07 dsardar099

@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

tyrauber avatar Jul 17 '24 08:07 tyrauber

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 ).

ngottlieb avatar Dec 11 '24 23:12 ngottlieb

Any update for this?

viettranbhsoft1 avatar Feb 05 '25 04:02 viettranbhsoft1

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 avatar Jun 02 '25 10:06 edurenye

@edurenye, I believe you can address this usecase with addCustomHeader.

tyrauber avatar Jun 02 '25 15:06 tyrauber

Thank you very much @tyrauber !

edurenye avatar Jun 02 '25 19:06 edurenye

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.

6TELOIV avatar Aug 26 '25 14:08 6TELOIV

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 avatar Aug 28 '25 05:08 KiwiKilian

@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.

6TELOIV avatar Aug 28 '25 15:08 6TELOIV