Skip to content

Commit

Permalink
Additional reference points for bounding volume calculation - globe v…
Browse files Browse the repository at this point in the history
…iew (visgl#6148)
  • Loading branch information
igorDykhta authored Sep 1, 2021
1 parent e26e60a commit 5c748fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/geo-layers/src/tile-layer/tile-2d-traversal.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const MAX_MAPS = 3;
// for calculating bounding volume of a tile in a non-web-mercator viewport
const REF_POINTS_5 = [[0.5, 0.5], [0, 0], [0, 1], [1, 0], [1, 1]]; // 4 corners and center
const REF_POINTS_9 = REF_POINTS_5.concat([[0, 0.5], [0.5, 0], [1, 0.5], [0.5, 1]]); // 4 corners, center and 4 mid points
const REF_POINTS_11 = REF_POINTS_9.concat([[0.25, 0.5], [0.75, 0.5]]); // 2 additional points on equator for top tile

class OSMNode {
constructor(x, y, z) {
Expand Down Expand Up @@ -89,7 +90,7 @@ class OSMNode {
// Custom projection
// Estimate bounding box from sample points
// At low zoom level we need more samples to calculate the bounding volume correctly
const refPoints = this.z < 2 ? REF_POINTS_9 : REF_POINTS_5;
const refPoints = this.z < 1 ? REF_POINTS_11 : this.z < 2 ? REF_POINTS_9 : REF_POINTS_5;

// Convert from tile-relative coordinates to common space
const refPointPositions = [];
Expand Down

0 comments on commit 5c748fc

Please sign in to comment.