Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[test runner] Support independent tile rendering in tile mode #16068

Merged
merged 3 commits into from
Dec 18, 2019

Conversation

pozdnyakov
Copy link
Contributor

This PR enables test runner rendering tiles independently in tile mode, so that the issues on tile boundaries can be discovered (pls see below).
issues_on_tile_borders

This change is applicable for all render tests with mapMode option set to tile, i.e.

  "metadata": {
    "test": {
      "mapMode": "tile"
    }
  }

Fixes https://github.com/mapbox/mapbox-gl-native-team/issues/94

cc @springmeyer @mapbox/static-apis

@pozdnyakov pozdnyakov self-assigned this Dec 17, 2019
@pozdnyakov pozdnyakov force-pushed the mikhail_render_test_tile_mode branch from f0c0875 to b6b5fcb Compare December 17, 2019 14:54
@pozdnyakov pozdnyakov marked this pull request as ready for review December 17, 2019 14:54
@pozdnyakov pozdnyakov force-pushed the mikhail_render_test_tile_mode branch from b6b5fcb to b7b6a0b Compare December 17, 2019 15:28
LatLng getTileCenterCoordinates(const UnwrappedTileID& tileId) {
double scale = (1 << tileId.canonical.z) / util::tileSize;
Point<double> tileCenter{tileId.canonical.x + 0.5, tileId.canonical.y + 0.5};
return Projection::unproject(tileCenter, scale);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Projection::unproject expects position values to be in world coordinates (or is it called pixel coordinates?) Would it make more sense to multiply tileCenter with 1 << tileId.canonical.z rather than dividing the scale value with util::tileSize?

@pozdnyakov pozdnyakov force-pushed the mikhail_render_test_tile_mode branch from b7b6a0b to 8f1bbfc Compare December 18, 2019 11:12
@pozdnyakov pozdnyakov merged commit 205f0e2 into master Dec 18, 2019
@pozdnyakov pozdnyakov deleted the mikhail_render_test_tile_mode branch December 18, 2019 11:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants