List all tiles in viewport #2247
-
Following a question on the mapbox-gl-js repo here, I wondered if this is a feature which is offered by react-map-gl itself - I've got a feeling I've seen something similar around the react-map-gl github repo or doc in the past. I've got a map with a TMS source and layer, and I'd like to get a list of all tiles displayed for current viewport. This would allow me to parse the tiles URLs and fetch some header propreties of the responses of all the tile requests (to aggregate a tile-date per-tile property into a min/max date for the viewport). Thanks a lot for your help - and again, really useful library. Edit: what I'm after is probably inside math.gl. Getting visibleTiles should be an easy task - although I would have hoped to be able to get it directly from a loadedTiles list to avoid discrepancies between the tiles loaded in the viewport and the computation done via another piece of code. Plus an existing solution would let me get loaded tiles for all configurations (globe or equal-earth projection, pitch different than zero etc rather than only for the standard web-mercator case). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
react-map-gl is just a wrapper of the base map library. It does not contain any tile fetching or rendering logic. If mapbox-gl adds an API you can access it via the MapRef object. |
Beta Was this translation helpful? Give feedback.
react-map-gl is just a wrapper of the base map library. It does not contain any tile fetching or rendering logic. If mapbox-gl adds an API you can access it via the MapRef object.