Repository navigation
Add option to prefetch low-resolution tiles - #14031
Conversation
1ec5
left a comment
There was a problem hiding this comment.
Suggested changelog entry:
- Added an
MGLMapView.prefetchesTilesproperty that you can disable if you don’t want to prefetch simplified tiles as a performance optimization. (#14031)
@tmpsantos, are you comfortable with the approach of making this a Boolean option, as I proposed in #9438 (comment), or do you think developers need the flexibility of specifying a zoom level to prefetch?
| else | ||
| { | ||
| //Reset to default value. | ||
| _mbglMap->setPrefetchZoomDelta(4); |
There was a problem hiding this comment.
Per #9438 (comment), use the constant DEFAULT_PREFETCH_ZOOM_DELTA instead of hard-coding the literal number 4. Also, the if/else statement can be written more succinctly as a ternary expression: setPrefetchZoomDelta(prefetchesTiles ? DEFAULT_PREFETCH_ZOOM_DELTA : 0).
|
|
||
| Loads tiles at a lower zoom-level to pre-render a low resolution preview while more detailed tiles are loaded. | ||
|
|
||
| Default is YES. |
There was a problem hiding this comment.
The developer may be unfamiliar with the concept of prefetching simplified tiles, so here’s an attempt at making the mechanism easy to understand:
When this property is set to
YES, the map view prefetches loads tiles designed for a low zoom level and displays them until receiving more detailed tiles for the current zoom level. The prefetched tiles typically contain simplified versions of each shape, improving the map view’s perceived performance. The default value of this property isYES.
There was a problem hiding this comment.
Cool. That's a better one. I'll change to that.
FYI, this has been implemented only with a boolean value on Android side. @1ec5 |
I'm ok with the boolean option for the sake of consistence with Android. |
| ## master | ||
|
|
||
| * Client-side text rendering of CJK ideographs is now enabled by default. ([#13988](https://github.com/mapbox/mapbox-gl-native/pull/13988)) | ||
| * Added an MGLMapView.prefetchesTiles property that you can disable if you don’t want to prefetch simplified tiles as a performance optimization. ([#14031](https://github.com/mapbox/mapbox-gl-native/pull/14031)) |
There was a problem hiding this comment.
Nit: the backticks help jazzy automatically link to the property’s documentation:
| * Added an MGLMapView.prefetchesTiles property that you can disable if you don’t want to prefetch simplified tiles as a performance optimization. ([#14031](https://github.com/mapbox/mapbox-gl-native/pull/14031)) | |
| * Added an `MGLMapView.prefetchesTiles` property that you can disable if you don’t want to prefetch simplified tiles as a performance optimization. ([#14031](https://github.com/mapbox/mapbox-gl-native/pull/14031)) |
Closes: #9438
We got a loading issue report from our customer.
I've added a boolean-typed prefetchesTiles property to MGLMapView to fix this issue.
Could you help to review these codes? @1ec5 @friedbunny