-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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.isMoving() match move events fix #9647 #9679
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,12 +39,18 @@ test('Map#isMoving returns true during a camera zoom animation', (t) => { | |
test('Map#isMoving returns true when drag panning', (t) => { | ||
const map = createMap(t); | ||
|
||
map.on('movestart', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know if we have enough coverage around whether those events are triggered under a similar context? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test case is focused around Maybe collecting how many times those lambdas are called and testing that at the end of this block could be useful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in this case there is enough coverage elsewhere but we could change the test to avoid this problem. |
||
t.equal(map.isMoving(), true); | ||
}); | ||
map.on('dragstart', () => { | ||
t.equal(map.isMoving(), true); | ||
}); | ||
|
||
map.on('dragend', () => { | ||
t.equal(map.isMoving(), false); | ||
}); | ||
map.on('moveend', () => { | ||
t.equal(map.isMoving(), false); | ||
map.remove(); | ||
t.end(); | ||
}); | ||
|
@@ -65,12 +71,18 @@ test('Map#isMoving returns true when drag rotating', (t) => { | |
// Prevent inertial rotation. | ||
t.stub(browser, 'now').returns(0); | ||
|
||
map.on('movestart', () => { | ||
t.equal(map.isMoving(), true); | ||
}); | ||
map.on('rotatestart', () => { | ||
t.equal(map.isMoving(), true); | ||
}); | ||
|
||
map.on('rotateend', () => { | ||
t.equal(map.isMoving(), false); | ||
}); | ||
map.on('moveend', () => { | ||
t.equal(map.isMoving(), false); | ||
map.remove(); | ||
t.end(); | ||
}); | ||
|
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.
This particular test is now failing from CI, is this call actually processing the events correctly?
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 was missing another one of these calls after the next event.
In old releases
map.isMoving()
would return true immediately after amousemove
event that causes a rotation. Nowmap.isMoving()
only returns true on the next frame when the move events have fired and the camera events have changed. Does this seem ok to you?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 would not think that having a one frame delay difference for this type of API as being critical. As long as we still cover the following requirements: