Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
expose field of view option #3796
This is a big wall of text but the actual implementation should be short.
You want to change how perspective-y the map looks, either to match the fov in some other piece of software or to just change the appearance of a 3D map to make you look closer or more distant.
Field of view
Field of view is usually specified as an angle in either the x or y direction. Since maps can exist at variable aspect ratio and resolutions, the fov needs to be scaled at least in one direction. For example, if you stretch a map horizontally does the horizontal fov change? or does the vertical fov change? or do they both change? Here is an overview of some of the options. The main options are:
focal_length / dolly zoom / old altitude
Field of view could alternatively be specified as the distance from the camera to the center. This is basically the dolly zoom effect. The old internal
It's an option since this is mostly a nice-to-have but the cost of supporting it isn't high.
We should expose
Field of view is better than
I think either
We should have a fixed vertical fov. This is the most common approach in games and is better suited for wider aspect ratios. This is what is currently implemented.
field of view
Video games, 3d graphics libraries.
The core of this is already implemented. The
This would be very useful for us. I just had an exchange with support about this same question today.
Our use case is we are integrating Mapbox with our own 3D map. To do a smooth crossfade between 2D and 3D we need information about the real-world location of the Mapbox camera. Today we're trying to figure out how to estimate this given the information available through the public API.
@drhase2 It sounds like this feature implementation will be as easy as wiring up a private property to some external getters / setters. Any interest in putting together a PR?
(Also, FWIW, you may prototype this feature using the existing private API: