-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] Add runtime API for setting tile prefetch delta for a Source #16179
Conversation
f0ebf79
to
f2dc599
Compare
775234a
to
ec46f46
Compare
ec46f46
to
8073c0e
Compare
New setPrefetchZoomDelta(optional<uint8_t> delta) method allow overriding default tile prefetch setting that is defined by the Map instance. The method can be moved to generic style specification if found to be useful for gl-js engine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % questions
…icant change Clear tile pyramid only if updated source has different tile options, zoom range or initialization state for a custom tile loader.
Test verifies that tile pyramid will request only 4 tiles for current zoom level, if Source's setPrefetchZoomDelta is 0.
8073c0e
to
a537489
Compare
@alexshalamov downstream we are implementing code generation for Sources similar to what we already have for layers/properties/light etc from the style spec today. Should this configuration be exposed through the style spec? https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/ update: just seeing |
@asheemmamoowala Do you think adding prefetchDelta to sources specification would be useful to gl-js? If so, I can start working on it next sprint. @tobrun meanwhile, would it be possible to add an exception and generate setter / getter for all sources? I think generator already has exceptions, since some of the features are not implemented in native (e.g., promoteId). |
@alexshalamov I'm going to have to defer to @kkaefer @mourner on this. Cancelling and managing tasks in WebWorkers is different from native threads, so this may not work as well in gl-js as it does in native. |
The new
Source::setPrefetchZoomDelta(optional<uint8_t> delta)
method allows overriding default tile prefetch setting that is defined by the Map instance. The method can be moved to a generic style specification if found to be useful for gl-js engine.Launch Checklist
@mapbox/maps-android @mapbox/maps-ios @mapbox/core-sdk
if this PR adds or updates a public API@mapbox/gl-js
if this PR includes shader changes or needs a js portneeds changelog
label if a changelog is needed (remove label when added)/cc @mapbox/gl-js @mapbox/core-sdk