mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
10.88k stars 2.19k forks source link

Add orthographic camera mode #12132

Open alberto-taiuti-skydio opened 1 year ago

alberto-taiuti-skydio commented 1 year ago

Motivation

It would be very useful to have an orthographic projection rather than only a perspective one available. This would allow us to present the Mapbox 3D map view, alongside some other ThreeJS content, both with an orthographic projection, and hence create some interactions that would work much better if shown while using an orthographic projection.

Design

The best option would be to offer the ability to change the projection being used like ThreeJS does: ThreeJS offers a perspective camera and an orthographic camera which you can change at runtime.

alberto-taiuti-skydio commented 1 year ago

Any updates? 👀

thadk commented 3 months ago

According to https://github.com/mapbox/mapbox-gl-js/issues/13081 the syntax is: map.setCamera({"camera-projection": "orthographic"}) / map.setCamera({"camera-projection": "perspective"}) The link I saw in the documentation itself appeared broken. This blog post discussed the difference: https://blog.mapbox.com/designing-perspective-maps-in-studio-9194ce6a5f22