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

Globe - Improve tile management #3887

Open
Pheonor opened this issue Mar 23, 2024 · 4 comments
Open

Globe - Improve tile management #3887

Pheonor opened this issue Mar 23, 2024 · 4 comments
Assignees
Labels
💰 bounty M Medium Bounty, USD 250 enhancement New feature or request PR is more than welcomed Extra attention is needed

Comments

@Pheonor
Copy link
Contributor

Pheonor commented Mar 23, 2024

Rationale

Tile loading mechanism should be updated to work with a Globe projection.

Impact

Load every tile needed to cover the whole Globe with the right resolution.

@HarelM
Copy link
Collaborator

HarelM commented Mar 24, 2024

Bounty direction:
maplibre/maplibre#190

@HarelM HarelM added enhancement New feature or request PR is more than welcomed Extra attention is needed 💰 bounty M Medium Bounty, USD 250 labels Mar 24, 2024
@vlarrieu
Copy link

vlarrieu commented Mar 24, 2024

@HarelM Could you assign it to me please ?
(On Pheonor account, sorry)

@kubapelc kubapelc mentioned this issue May 20, 2024
8 tasks
@kubapelc
Copy link
Collaborator

kubapelc commented Jun 20, 2024

@Pheonor Hi, I'm currently doing a lot of changes in my branch that affect how this would be implemented. Since your other PR is nearly finished, I thought I should tell you about this so we can avoid hard to solve merge conflicts :)

I've moved most logic from the Projection interface to the Transform class. Transform is now an abstract class, with implementations for mercator and globe projections. I decided to do this, because Transform is the class already used by MapLibre to do everything related to projecting and unprojecting pixels and coordinates. Transform also already stores the map's center, pitch, bearing, etc., which is all needed for projections.

Transform is also cloneable in MapLibre, and this is used to store the map's state from a given frame, and use it for a longer period of time to do projections. This is used in symbols, and the old Projection interface didn't account for this at all, so the globe symbol implementation was slightly wrong. Moving most projection stuff to Transform fixes this.

I think the abstract transform mightmake implementing better tile management for different projections easier.

You can preview the changes here:

https://github.com/windycom/maplibre-gl-js/blob/kubapelc/globe-vector/src/geo/projection/globe_transform.ts

https://github.com/windycom/maplibre-gl-js/blob/kubapelc/globe-vector/src/geo/transform.ts

I hope to have a PR ready within about two weeks (hopefully).

@Pheonor
Copy link
Contributor Author

Pheonor commented Jun 23, 2024

@Pheonor Hi, I'm currently doing a lot of changes in my branch that affect how this would be implemented. Since your other PR is nearly finished, I thought I should tell you about this so we can avoid hard to solve merge conflicts :)

I've moved most logic from the Projection interface to the Transform class. Transform is now an abstract class, with implementations for mercator and globe projections. I decided to do this, because Transform is the class already used by MapLibre to do everything related to projecting and unprojecting pixels and coordinates. Transform also already stores the map's center, pitch, bearing, etc., which is all needed for projections.

Transform is also cloneable in MapLibre, and this is used to store the map's state from a given frame, and use it for a longer period of time to do projections. This is used in symbols, and the old Projection interface didn't account for this at all, so the globe symbol implementation was slightly wrong. Moving most projection stuff to Transform fixes this.

I think the abstract transform mightmake implementing better tile management for different projections easier.

You can preview the changes here:

https://github.com/windycom/maplibre-gl-js/blob/kubapelc/globe-vector/src/geo/projection/globe_transform.ts

https://github.com/windycom/maplibre-gl-js/blob/kubapelc/globe-vector/src/geo/transform.ts

I hope to have a PR ready within about two weeks (hopefully).

Thanks for the information @kubapelc. I already start this issue but I will wait your refactoring.

This is a great change. When I first test the tile improvement, I was facing the problem of update of transform information that are needed by the projection code.
Good job !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💰 bounty M Medium Bounty, USD 250 enhancement New feature or request PR is more than welcomed Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants