Repository navigation
Conversation
…y props Expose two Mapbox v11 raster source options that were not reachable from JavaScript: - prefetchZoomDelta: how many zoom levels above the current one are requested as placeholders while the current tiles load. 0 turns the prefetch off. - tileNetworkRequestsDelay: milliseconds to wait before a tile's network request goes out during a gesture or camera animation, so tiles that leave the viewport first are never requested. Both map straight to the native source builders on iOS and Android. Docs regenerated with yarn generate, and a new example scene uses both props. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
mfazekas
requested changes
Oct 21, 2026
mfazekas
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this is useful and the wiring matches tileSize on both platforms. A few changes before merging:
- Android:
setPrefetchZoomDelta/setTileNetworkRequestsDelayinRNMBXRasterSourceManagercallasInt()/asDouble()without checkingvalue.isNull. If an app sets one of these props and later removes it, Fabric passes a nullDynamicand the call throws. Please skip (or reset tonull) when the value is null. - The
prefetchZoomDeltadoc says tiles "up to this many zoom levels above it" are requested. Per the SDK, the map first requests a single lower-zoom tile, at a zoom belowzoom - deltarounded to a multiple ofdelta, to show a coarse map quickly. Please align the wording with that. - Both props are only read when the source is created, so changing them after mount has no effect. Please say so in both docs.
- The example uses
tile.openstreetmap.orgwith no attribution; OSM's tile usage policy requires it and discourages app traffic. Either addattributionon the source or reuse the tile URL from the existingRasterSourceexample.
We'll also check the Android side at runtime on an emulator, since it has only been compile-checked so far.
oliverfernandez
temporarily deployed
to
default
October 21, 2026 07:40 — with
GitHub Actions
Inactive
oliverfernandez
temporarily deployed
to
default
October 21, 2026 07:40 — with
GitHub Actions
Inactive
oliverfernandez
temporarily deployed
to
default
October 21, 2026 07:40 — with
GitHub Actions
Inactive
…efetch-and-network-delay
…docs, add example attribution
Contributor
|
Thanks @oliverfernandez! Since this has been quiet for a while, we have taken it over and pushed the remaining review fixes on top: null-safe prop removal on Android, corrected |
mfazekas
approved these changes
Nov 9, 2026
mfazekas
left a comment
Contributor
There was a problem hiding this comment.
Review fixes are in; verified on Android.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added
prefetchZoomDeltaandtileNetworkRequestsDelayprops toRasterSource. They expose two Mapbox v11 raster source options that are set today only by the SDK defaults:prefetchZoomDelta: when greater than 0, the map first requests a tile at a zoom level belowzoom - delta, rounded to a multiple of the delta, to show a low-resolution map quickly. Mapbox defaults to 4.0turns the prefetch off, which suits overlays such as weather radar where the placeholder is never visible.tileNetworkRequestsDelay: milliseconds to wait before a tile's network request goes out while a gesture or camera animation is in progress. Tiles that leave the viewport before the delay elapses are never requested. Mapbox defaults to 0.Both map straight to
RasterSource.prefetchZoomDelta/tileNetworkRequestsDelayon iOS andRasterSource.Builder.prefetchZoomDelta()/tileNetworkRequestsDelay()on Android. They are read when the source is created, like the other source props.Motivation: a weather app with 25 raster frames at one camera position. With the defaults, each frame also fetched parent tiles it never showed, and a pan requested tiles for positions the finger had already left. With these two options the same open costs a quarter of the tile requests.
Checklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)Testing notes: verified on iOS (v11, New Architecture) and compiled on Android (v11, New Architecture) through a production React Native 0.81 app that consumes this branch as a patch: the Fabric codegen picks up the new spec props, the component view and the Swift source compile, the Kotlin manager and source compile, and the raster tiles render on the iOS simulator with
prefetchZoomDelta={0}andtileNetworkRequestsDelay={200}. A proxy capture on iOS confirmed that only tiles of the current zoom level are requested. Android was compile-checked only; the new example sceneRasterSourceTileRequestsis the place to confirm it at runtime.Screenshot OR Video
No visual change. The example scene
Fill/Raster Layer > Raster Source tile requestsshows the props in use; compare the network log withRaster Sourcewhile panning.