nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 697 forks source link

Custom RasterSource constantly requests tile server when panning #1627

Open dorthwein opened 5 years ago

dorthwein commented 5 years ago

When using a RasterSource moving the map causes a new request to the tile server.

Is there a way to cache these on the client to avoid the additional requests? I understand mapbox does this on its own but doesn't seem to be doing it for the custom tile set.

This is another question to a similar issue. It seems mapbox should be doing this internally but is not.

https://github.com/nitaliano/react-native-mapbox-gl/issues/1087

Example code causing the spamming

<MapboxGL.RasterSource id="aerisWeather-windGusts" url={url} tileSize={256}> <MapboxGL.RasterLayer id="aerisWeatherLayer-windGusts" sourceID="aerisWeather-windGusts" /> </MapboxGL.RasterSource>