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 view - Earth is not flat #307

Open
Playzinho opened this issue Sep 4, 2021 · 21 comments
Open

Globe view - Earth is not flat #307

Playzinho opened this issue Sep 4, 2021 · 21 comments
Labels
enhancement New feature or request PR is more than welcomed Extra attention is needed

Comments

@Playzinho
Copy link

Motivation

Hello, I think it would be interesting when zooming out instead of duplicating the merchant projection it would be nice to show the view of the entire globe, similar to google earth and the new Apple Maps

Design Alternatives

i-OS-15-Maps-Feature.jpg
globe-view.png

Design

Mock-Up

Concepts

Implementation

@HarelM
Copy link
Member

HarelM commented Sep 4, 2021

I think this would be great, but I don't have the slightest clue how to implement this.
Your best approach would be to submit a PR after implementing this. I also think this should be configurable for people that wouldn't want this...
Also there's a need to make sure this does not cause performance issues in terms of fetching too many tiles...
But, sure, this feature would be very nice to have :-)

@wipfli
Copy link
Member

wipfli commented Sep 4, 2021

Happy to review pull requests on this too. Here is a link that @klokan gave me:

https://observablehq.com/@fil/webmercator-to-globe?collection=@fil/glsl-projections

@Malvoz
Copy link
Contributor

Malvoz commented Sep 5, 2021

I'm not sure if/how relevant this MapBox GL JS issue is: mapbox/mapbox-gl-js#10784, perhaps informative if anything?

@HarelM
Copy link
Member

HarelM commented Sep 5, 2021

Well, looks like someone from mapbox is coding it so we can't use it due to licencing issues.
By the amount of corner cases that this thread is talking about it seems like a huge effort, but if you are up for the challenge, why not? :-)

@wipfli
Copy link
Member

wipfli commented Sep 6, 2021

@Malvoz thanks for posting the related Mapbox link here. If someone is going to implement this feature in MapLibre GL JS you could maybe act as a referee who makes sure that we don't copy-paste their proprietory code.

@rbrundritt
Copy link
Contributor

I suspect this would be a pretty large work effort to achieve and would only be good for a small subset of business scenarios. This would not be good for data visualizations where users are looking to get business insights most of the time as they will need to see all the data.

@HarelM
Copy link
Member

HarelM commented Sep 17, 2021

This can be an opt-in. I don't see a problem in theory if someone world like to do this.

@rbrundritt
Copy link
Contributor

My main concern would be how much this feature would in flat the project. If it grows the code base by 10% for something that would be use 5% of the time, should this be out of the box, or is there a modular approach that could be implemented?

@HarelM
Copy link
Member

HarelM commented Sep 17, 2021

Let's have this discussion if someone decides to implement this, this is currently not the case as far as I know...

@github-actions
Copy link
Contributor

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Mar 17, 2022
@nyurik
Copy link
Member

nyurik commented Mar 17, 2022

The title sounds so self-righteous, like the author knows everything! What if it is? 🌍 -- it could be flat if you look from its side :)

@github-actions github-actions bot removed the Stale label Mar 18, 2022
@alienatorZ
Copy link

Has there been any movement on this?

@wipfli
Copy link
Member

wipfli commented May 4, 2022

Not that I know...

@wipfli
Copy link
Member

wipfli commented May 4, 2022

Would it be nice for you to have?

@am2222
Copy link

am2222 commented May 11, 2022

Would be nice to have the discussion and steps to take.

@klokan
Copy link
Member

klokan commented May 11, 2022

Anybody keen in jumping on implementation of the "Adaptive Composite Map Projection" (google this)?

It is the math. R&D done 10 years ago. Going from Orthographic projection of the globe to the Mercator as you zoom in.
This is what Google Maps implemented - and now Mapbox too - on the upper zoom levels.

https://berniejenny.info/demos/AdaptiveCompositeMapProjections/
https://github.com/OSUCartography/adaptive-composite-map-projections

If you want it to be done - send a vote to https://roadmap.maplibre.org/ on it :-)

@HarelM HarelM added enhancement New feature or request PR is more than welcomed Extra attention is needed labels Aug 17, 2022
@HarelM
Copy link
Member

HarelM commented Aug 17, 2022

Might be related to #168 I guess...

@prozessor13
Copy link
Collaborator

I think the easies way to implement globe-view would be to:

  • reuse terrain render-to-texture logic to create raster-tiles for the current style
  • create a new shader for globe view, which projects tile-coordinates from the terrain-mesh to a sphere via:
    • project to epsg4326 (= degrees)
    • and then with sin/cos to a sphere
    • fill the poles with trianles from terrain-mesh to the poles
  • paint the raster-tiles to the sphere terrain-mesh

This approach has nothing to do with other projections like albert or so, but may this can be done in a similar way?

@wipfli
Copy link
Member

wipfli commented May 15, 2023

Interesting @prozessor13. Would that also handle labels?

@prozessor13
Copy link
Collaborator

No, label position/placement must be calculated in CPU, but in the same way.
Coordinate picking in the map on the other hand should be not too complicated, because of the coords-framebuffer, which holds all coordinates in a hidden gpu-framebuffer, which should be working in every projection.

@tangzijun
Copy link

expect

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

No branches or pull requests