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

add Map#isZooming method #6128

Merged
merged 2 commits into from
Feb 12, 2018
Merged

add Map#isZooming method #6128

merged 2 commits into from
Feb 12, 2018

Conversation

mollymerp
Copy link
Contributor

Resolves #6119

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page

@mollymerp mollymerp mentioned this pull request Feb 9, 2018
lbud
lbud previously requested changes Feb 9, 2018
src/ui/camera.js Outdated
@@ -855,7 +855,17 @@ class Camera extends Evented {
* @returns A Boolean indicating whether the camera is moving.
*/
isMoving(): boolean {
return this.moving;
return !!this.moving;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since moving and zooming are both boolean members of the Camera class already, let's remove the double negation here and below and just return this.moving / this.zooming.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this.zooming wasn't initialized in the constructor, so it could be undefined but I've initialized it as false in a new commit and removed the !!

@mollymerp mollymerp merged commit c015885 into master Feb 12, 2018
@mollymerp mollymerp deleted the is-zooming branch February 12, 2018 17:39
pathmapper pushed a commit to pathmapper/mapbox-gl-js that referenced this pull request Feb 13, 2018
* add Map#isZooming method

* initialize Camera#zooming
pathmapper pushed a commit to pathmapper/mapbox-gl-js that referenced this pull request Feb 13, 2018
* add Map#isZooming method

* initialize Camera#zooming
@mollymerp mollymerp restored the is-zooming branch November 5, 2018 23:37
@mourner mourner deleted the is-zooming branch August 1, 2019 11:48
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

Successfully merging this pull request may close these issues.

3 participants