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

[TileLayer] fix tile indices generation in edge cases #4170

Merged
merged 2 commits into from
Jan 21, 2020

Conversation

Pessimistress
Copy link
Collaborator

When the viewport's longitude is close to the 180th meridian, the bounding box will look something like

minX maxX
boundingBox -200 -150
tileIndex (z=4) -0.88 1.33

The old calculation clamps tileX to [0, scale] which was incorrect. tileX should loop between [0, scale] as the map repeats.

In the above case, the old calculation returns [0, 0, 4] and [1, 0, 4]. The correct result should be [0, 0, 4], [1, 0, 4] and [15, 0, 4].

Change List

  • Fix bug in getTileIndices
  • Unit tests

@coveralls
Copy link

coveralls commented Jan 18, 2020

Coverage Status

Coverage decreased (-2.5%) to 80.927% when pulling 1d81b88 on x/tile-indices-fix into ff55172 on master.

@Pessimistress Pessimistress merged commit 13c90fd into master Jan 21, 2020
@Pessimistress Pessimistress deleted the x/tile-indices-fix branch January 21, 2020 21:27
tgorkin added a commit that referenced this pull request Jan 28, 2020
* master: (82 commits)
  fix typo in performance.md
  pydeck: ArcLayer, BitmapLayer, ColumnLayer examples (#4189)
  [React] fix missing key error (#4193)
  [Bug] Fix hexagon layer projection (#4173)
  Remove HtmlWebpackPlugin from examples/playground (#4178)
  @deck.gl/json: Fix bug dropping props with falsy values (#4185)
  Fix buffer size check in Attribute.updateBuffer (#4190)
  Bump luma dependency (#4191)
  data-filter: support double precision (#4163)
  Use int type for enum uniforms (#4171)
  [TileLayer] fix tile indices generation in edge cases (#4170)
  v8.1.0-alpha.1
  Voodoo fix for Mac+NVIDIA bug (#4166)
  Remove unnecessary code from project glsl (#4162)
  Fix H3HexagonLayer update when viewport jumps (#4158)
  Refactor render tests; use stricter pass criteria (#4157)
  [Extension] Add source_target to brushing mode (#4150)
  Add offset feature to PathStyleExtension (#4126)
  Project module: support pre-projected positions (#4140)
  Repeat maps at low zoom levels (#4105)
  ...
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.

3 participants