maplibre / maplibre-gl-js

MapLibre GL JS - Interactive vector tile maps in the browser
https://maplibre.org/maplibre-gl-js/docs/
Other
6.58k stars 705 forks source link

Globe view - Earth is not flat #307

Closed Gustavo22Soaresh closed 1 month ago

Gustavo22Soaresh commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

HarelM commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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

rbrundritt commented 3 years ago

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 commented 3 years ago

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

github-actions[bot] commented 2 years ago

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.

nyurik commented 2 years ago

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

alienatorZ commented 2 years ago

Has there been any movement on this?

wipfli commented 2 years ago

Not that I know...

wipfli commented 2 years ago

Would it be nice for you to have?

am2222 commented 2 years ago

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

klokan commented 2 years ago

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 commented 2 years ago

Might be related to #168 I guess...

prozessor13 commented 1 year ago

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

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

wipfli commented 1 year ago

Interesting @prozessor13. Would that also handle labels?

prozessor13 commented 1 year ago

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 commented 10 months ago

expect