mapbox / mapbox/mapbox-gl-js

improve lod tile loading for projections

Open
#11,233 1 comment 0 reactions 1 assignee View on GitHub

@mourner is already working on this.

Since Nov 5, 2021.

performance :zap:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/mapbox/mapbox-gl-js/pull/11225 improved level-of-detail tile loading for projections but there is still one major issue. It uses the center of the mercator tile to calculate the tile's scale. This is problematic when the center of the mercator tile is very far from the center of the tile in a different projection.

For example, with `{ name: 'albers', parallels: [90, 90] }` the z1 tile does not split early enough because the point at which it calculates the scale is still at an ok size.

This should be split:
![Screen Shot 2021-11-04 at 10 27 13 PM](https://user-images.githubusercontent.com/1421652/140448694-03e01deb-c6d0-4080-8c74-36303b22ab28.png)
After it splits, you can see how far north the center is:
![Screen Shot 2021-11-04 at 10 27 26 PM](https://user-images.githubusercontent.com/1421652/140448705-327c17f0-b8d2-4937-a42e-dbca15064c07.png)

Possible fixes might be:
- use center of the tile in LngLat instead of mercator
- use some other measure of center
- use some non-center area based measurement

I'm not sure, but this might be a performance sensitive spot.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.