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

[BUG] Zero-pitch change ignored #334

Closed
YaroslavKormushyn opened this issue Oct 7, 2021 · 2 comments
Closed

[BUG] Zero-pitch change ignored #334

YaroslavKormushyn opened this issue Oct 7, 2021 · 2 comments

Comments

@YaroslavKormushyn
Copy link
Contributor

I have found that when setting the pitch dynamic property to [0] the change does not propagate to the map instance. This is because when checking the values of the move method options we ignore all 'falsy' values instead of checking for an actual value.

return this.zone.runOutsideAngular(() => {
(<any>this.mapInstance[movingMethod])({
...movingOptions,
zoom: zoom ? zoom : this.mapInstance.getZoom(),
center: center ? center : this.mapInstance.getCenter(),
bearing: bearing ? bearing : this.mapInstance.getBearing(),
pitch: pitch ? pitch : this.mapInstance.getPitch(),
});
});

This check for zoom or center makes perfect sense, but for bearing and pitch zero values should be taken into account.
What do you think?

@dmytro-gokun
Copy link
Collaborator

@YaroslavKormushyn You are probably right and we should use '!= null' comparison for all four parameters. Please go ahead and put up a PR

YaroslavKormushyn added a commit to YaroslavKormushyn/ngx-mapbox-gl that referenced this issue Oct 8, 2021
YaroslavKormushyn added a commit to YaroslavKormushyn/ngx-mapbox-gl that referenced this issue Oct 8, 2021
@YaroslavKormushyn
Copy link
Contributor Author

Fixed in #335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants