feat(TileLayer): Add visibleMinZoom & visibleMaxZoom props#10091
feat(TileLayer): Add visibleMinZoom & visibleMaxZoom props#10091felixpalmer wants to merge 9 commits intomasterfrom
Conversation
|
|
||
| - Default: 0 | ||
|
|
||
| #### `overdraw` (boolean, optional) {#overdraw} |
There was a problem hiding this comment.
Good name? overzoom?
|
It has always been a point of confusion because minZoom and maxZoom sounds symmetrical, but they work differently. There are two behaviors - visibility and fetching - that the users may want to control in underzoom/overzoom. I personally think we should have four props for each of these. |
|
@Pessimistress so would you be in favour of:
|
|
How about naming the new props:
Along the same lines as the |
|
No big objections other as long as we put in some effort on the prop naming, to make this as orthogonal, expandable and intuitive as we can. FWIW
Just mill for the grist if we are ideating about such props. |
|
I could imagine I also have run into the "refinement" use case you've mentioned @ibgreen. Maplibre has a nice implementation of this. I'm in favor of starting with the TileLayer and eventually extending it to the base Layer. I think it'd also be nice if visibility toggles could be configured to dissolve - today one can set |
|
@chrisgervang @ibgreen I've reworked this to use |
Background
The
extentprop inTileLayercontrols whether tiles are fetched & drawn when the viewport zoom is belowminZoom, but there is no mechanism to control this for zooms abovemaxZoom. It is also a common source of confusion on whether these props control the levels at which data is loaded or shown.New API
Two new props are added:
visibleMinZoom: The zoom below whichTileLayerwill not drawvisibleMaxZoom: The zoom above whichTileLayerwill not drawTo illustrate the interplay between all these props, the website
TileLayerexample is updated. SEE LIVE DEMOChange List
visibleMinZoom&visibleMaxZoomprops