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

[Feat] MapboxLayer / MapboxOverlay integration with globe projection #7920

Open
Beilinson opened this issue May 26, 2023 · 6 comments
Open
Labels

Comments

@Beilinson
Copy link

Target Use Case

In my organization we are required to use the Globe projection for our maps. Recently I stumbled upon the deck.gl library and would love to use it for the potential in additional 3D visualization it provides on top of mapbox.

However we quickly realized that although mapbox supports custom layers in globe view, the deck.gl layers don't update according to the projection which provides for some silly looking bugs like this one:

screen-capture.1.mp4

We'd love to contribute to the deck.gl library and get this behavior fixed, where should we look to begin with?

Proposal

The mapbox globe projection is an adaptive projection which gradually morphs from the 3d globe to a 2d mercator projection between zoom levels 6-8. Seeing as these are arbitrary numbers which could be changed in the future, the MapboxLayer / MapboxOverlay integration should always update its projection matrix (and any other dependent properties) by the current zoom projection so that it stays accurate. All points without height should also clamp to the spheroid, while datasources with height should be offset from the spheroid rather than the 2d plane in mercator projection.

@woozyking
Copy link

This would be amazing to have!

@chrisgervang
Copy link
Collaborator

We have some related issues, like visgl/react-map-gl#2091. We need mapbox to expose more of their camera parameters to pull this off. See more discussion in mapbox/mapbox-gl-js#12040. In particular:

The only way I can make Mapbox integrations forward-compatible, by eliminating all hacks, is if transform can be consistently reproduced via public APIs.

Also, @Pessimistress accomplished this in maplibre with maplibre/maplibre-gl-js#2535.. it'd be excellent if mapbox could implement this as well. It might not completely cover projections, but this is probably a pre-requisite...

@TtangBro
Copy link

Hello, can I learn the implementation code of the effect of your comment video

@kubbo
Copy link

kubbo commented Sep 11, 2023

Is the feature "MapboxLayer / MapboxOverlay integration with globe projection" planned for feture iterations ?
When can we expect it to be implemented?

@Pessimistress
Copy link
Collaborator

Mapbox does not currently support custom layers in globe projection. We can't do anything until they expose sufficient API for us to implement integration.

@Beilinson
Copy link
Author

If I'm not mistaken it seems that it does support custom layers for globe projection with parameters for both the mercator and globe + the transition between them:

mapbox/mapbox-gl-js#12182

mapbox/mapbox-gl-js#12544

What else is missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants