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

map.cameraForBounds returns undefined which is not mentioned in type definition #3760

Closed
yarkoyarok opened this issue Feb 28, 2024 · 1 comment · Fixed by #4096
Closed

map.cameraForBounds returns undefined which is not mentioned in type definition #3760

yarkoyarok opened this issue Feb 28, 2024 · 1 comment · Fixed by #4096
Labels
enhancement New feature or request PR is more than welcomed Extra attention is needed

Comments

@yarkoyarok
Copy link

maplibre-gl-js version: 2.4.0

browser: Chrome

Steps to Trigger Behavior

We did not find exact way to reproduce error in runtime, we had only exception report from user.

Link to Demonstration

Cannot be provided

Expected Behavior

map.cameraForBounds to return values of type defined

Actual Behavior

Sometimes we receive undefined from cameraForBounds(bounds: LngLatBoundsLike, options?: CameraForBoundsOptions): CenterZoomBearing but it not mentioned in type definition.

Here is actual return:

warnOnce(
'Map cannot fit within canvas with the given bounds, padding, and/or offset.'
);
return undefined;

@HarelM
Copy link
Collaborator

HarelM commented Feb 28, 2024

I'm not sure I fully understand the issue.
If this is a typing issue of the return value, feel free to open a PR to fix this.
Note that we usually don't patch old versions, so if you would like to fix it in 2.4 it's on you.

@HarelM HarelM added enhancement New feature or request PR is more than welcomed Extra attention is needed labels Feb 28, 2024
keichan34 added a commit to keichan34/maplibre-gl-js that referenced this issue May 10, 2024
HarelM pushed a commit that referenced this issue May 10, 2024
* Add undefined return type to map.cameraForBounds

Closes #3760

* Update CHANGELOG
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

Successfully merging a pull request may close this issue.

2 participants