-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support fractional minzoom on layers #5039
Conversation
115fe07
to
631315d
Compare
8ddc54d
to
ff8fa56
Compare
src/source/geojson_source.js
Outdated
@@ -190,7 +190,7 @@ class GeoJSONSource extends Evented implements Source { | |||
type: this.type, | |||
uid: tile.uid, | |||
coord: tile.coord, | |||
zoom: tile.coord.z, | |||
zoom: this.map.transform.zoom, |
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.
@asheemmamoowala I'd love to avoid another point of dependency of sources on the map
object (see also #3350).
Would an alternative to using the current map's zoom level be to keep using tile.coord.z
, but change the test to something like if (this.zoom < floor(layer.minzoom)) continue;
?
If I'm understanding this right, we want:
layer minzoom | tile zoom | tile needed? |
---|---|---|
4 | 3 (and below) | no |
4 | 4 (and above) | yes |
4.5 | 4 (and above) | yes |
4.5 | 3 (and below) | no |
"test": { | ||
"width": 512, | ||
"height": 512 | ||
} |
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.
Could we simplify this test a tad by:
- width & height: 64
- center 0,0
- data: literal geojson point
…trional minzoom's
612d60f
to
6d1c21b
Compare
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! Approving, notwithstanding a couple of small notes that I should have caught last time.
@@ -0,0 +1,38 @@ | |||
{ |
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.
Shoot, I should have thought of this before, but: could we move this test to render-tests/regressions/mapbox-gl-js#2929
?
"circle-color": "#EC8D8D", | ||
"circle-radius": 4 | ||
} | ||
} |
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.
Would it make sense to have two more layers with minzoom
4.5 and 5, that we would expect not to appear? (could use circle-translate
so each layer's dot would be in a distinct location)
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.
That's a good improvement to the test, Thanks !
6d1c21b
to
7a26885
Compare
This needs implementation in Native. |
Addresses : #2929
GeoJSON and Vector Tile sources are using a floor'ed zoom value when loading new tiles. This blocks tile data loaded for layers with fractional minzoom as it doesn't pass the test in worker_tile.js
The solution requires two changes
Checklist
document any changes to public APIs