-
Notifications
You must be signed in to change notification settings - Fork 14
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
Adding projection control and map instance logic #132
base: RD-369
Are you sure you want to change the base?
Conversation
readme.md
Outdated
## Field of view (FOV) | ||
The internal camera has a default vertical field of view [*(wikipedia)*](https://en.wikipedia.org/wiki/Field_of_view) of a wide ~36.86 degrees. In globe mode, such a large *FOV* reduces the amount of the Earth that can be seen at once and exaggerates the central part, comparably to a fisheye lens. In many cases, a narrower *FOV* is preferable. Here is how to update if: | ||
|
||
```ts | ||
// Ajust de FOV, with values from 1 to 50 | ||
map.transform.setFov(10); | ||
map.redraw(); | ||
``` | ||
> 📣 *__Note:__* with the Mercator projection, it is possible to set a FOV of `0`, which yields a true orthographic projection [*(wikipedia)*](https://en.wikipedia.org/wiki/Orthographic_projection), but the globe projection does not allow this. | ||
|
||
Here is a table of FOV comparison: | ||
| 01° | 10° | 20° | 30° | 40° | 50° | | ||
| :--------: | :-------: |:-------: |:-------: |:-------: |:-------: | | ||
| ![](images/screenshots/fov_1.jpeg) | ![](images/screenshots/fov_10.jpeg) | ![](images/screenshots/fov_20.jpeg) | ![](images/screenshots/fov_30.jpeg) | ![](images/screenshots/fov_40.jpeg) | ![](images/screenshots/fov_50.jpeg) | | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking whether this is not too specific and maybe does not need to be documented directly in the readme? (Especially since it adds several megabytes of data to the repo.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, there is now a public method to adjust the FoV nicely: maplibre/maplibre-gl-js@d3f2bca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've update the FOV function with the new built-in. As per removing this section entirely, I think now that's it's here and it's not going to be written anywhere else in probably at least the next few months, we better keep it.
This is adding the projection control as well as Map class methods to address the projection change in an easier and more complete way than Maplibre
This also include the readme documentation about projections