Skip to content
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

reparse overscaled tiles #1005

Merged
merged 1 commit into from
Feb 20, 2015
Merged

reparse overscaled tiles #1005

merged 1 commit into from
Feb 20, 2015

Conversation

ansis
Copy link
Contributor

@ansis ansis commented Feb 18, 2015

Fixes #1004

@jfirebaugh this was easier to handle by adding a couple special cases in Source and TileCoord than by loading multiple copies and clipping.

  • It uses the maxzoom to generate a cover, but creates tiles with the current zoom's z.
  • When generating the url, it uses maxzoom if z > maxzoom.
  • TileCoord's .parent() and .children() have a special case when z > maxzoom.

When the current zoom is past the vectortile source's maxzoom, load overscaled tiles and parse them specifically for the current integer zoom level. This is necessary to:

  • make layout property functions work
  • let us place labels only 1 zoom level deep (for performance)

Overscaled tile id's have the same x/y/w as their corresponding tiles from the source's maxzoom.

For example:

currentzoom: 18
maxzoom: 16

The overscaled tile { z: 18, x: 123, y: 456 }
loads the real tile { x: 16, x: 123, y: 456 }

@mourner
Copy link
Member

mourner commented Feb 18, 2015

  • fix GeoJSON disappearing after z15
  • fix tests

@mourner
Copy link
Member

mourner commented Feb 18, 2015

Also, considering underlying data is the same for overscaled tile and max zoom tile, could we change interpolation so that it doesn't jump when the overscaled tiles are loaded?

@ansis ansis closed this Feb 18, 2015
@ansis ansis reopened this Feb 18, 2015
@ansis
Copy link
Contributor Author

ansis commented Feb 18, 2015

fix GeoJSON disappearing after z15

Should we just remove maxzoom for geojson sources? or would it be better to also overscale geojson tiles?

Also, considering underlying data is the same for overscaled tile and max zoom tile, could we change interpolation so that it doesn't jump when the overscaled tiles are loaded?

Yes, we should look at this more carefully when all the other labeling stuff is done.

@mourner
Copy link
Member

mourner commented Feb 18, 2015

Should we just remove maxzoom for geojson sources? or would it be better to also overscale geojson tiles?

We could do either way. The advantage of overscaling vs generating new clipped tiles is potentially no jumpy tiles. cc @jfirebaugh

When the current zoom is past the vectortile source's maxzoom, load
overscaled tiles and parse them specifically for the current integer
zoom level. This is necessary to:
- make layout property functions work
- let us place labels only 1 zoom level deep (for performance)

Overscaled tile id's have the same x/y/w as their corresponding tiles
from the source's maxzoom. For example:

currentzoom: 18
maxzoom: 16

The overscaled tile { z: 18, x: 123, y: 456 }
loads the real tile { x: 16, x: 123, y: 456 }
@ansis
Copy link
Contributor Author

ansis commented Feb 18, 2015

Both tests and rendering tests pass (with mapbox/mapbox-gl-test-suite#17).
Geojson is also fixed.

@jfirebaugh
Copy link
Contributor

👍

@ansis ansis merged commit 55b4b39 into master Feb 20, 2015
@ansis ansis deleted the reparse-overscaled branch February 20, 2015 21:52
@kkaefer
Copy link
Contributor

kkaefer commented Feb 20, 2015

Can we get this ported to native?

@ansis
Copy link
Contributor Author

ansis commented Feb 20, 2015

@kkaefer I'll start on it soon. issue so that I don't forget: mapbox/mapbox-gl-native#912

@kkaefer
Copy link
Contributor

kkaefer commented Feb 20, 2015

Also, is this covered by tests?

@ansis
Copy link
Contributor Author

ansis commented Feb 20, 2015

mapbox/mapbox-gl-test-suite@28b6a25 adds rendering tests. Is there anything that should be covered by regular tests?

@kkaefer
Copy link
Contributor

kkaefer commented Feb 21, 2015

Can we use a few sample tiles and compare the output of the clipped tile algorithm with the expected result?

@ansis
Copy link
Contributor Author

ansis commented Feb 21, 2015

@kkaefer we're not actually clipping the data. It draws an overscaled tile the same way it used to draw it. The only change is that instead of reusing the same tile object, it creates a new tile object. It creates a new tile object so that layout property functions work and so that labelling gets reprocessed for that zoom level.

ansis added a commit to mapbox/mapbox-gl-native that referenced this pull request Apr 9, 2015
This reparses tiles at zoom levels > the sources maxzoom so that
layout property functions are applied and label are replaced.

mapbox/mapbox-gl-js#1005
and
mapbox/mapbox-gl-js@794c1eb
ansis added a commit to mapbox/mapbox-gl-native that referenced this pull request Apr 9, 2015
This reparses tiles at zoom levels > the sources maxzoom so that
layout property functions are applied and label are replaced.

mapbox/mapbox-gl-js#1005
and
mapbox/mapbox-gl-js@794c1eb
ansis added a commit to mapbox/mapbox-gl-native that referenced this pull request May 28, 2015
so that layout property functions are applied correctly
and so that label placement is redone

js:
mapbox/mapbox-gl-js#1005
and
mapbox/mapbox-gl-js@440bc02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reload, scale, and clip tiles for z > source.maxZoom
4 participants