mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-20 14:34:38 +00:00
Implemented missing logic for noMoveStart when using panTo function (#6685)
* Implemented missing logic for noMoveStart when using panTo function * Add test and apply suggestions from johnd0e Co-authored-by: Tobias Johansson <tobias_johansson@live.se> Co-authored-by: Florian Bischof <design.falke@gmail.com>
This commit is contained in:
@ -188,6 +188,21 @@ describe("Map", function () {
|
||||
expect(map.panBy.callCount).to.eql(1);
|
||||
expect(map.panBy.args[0][1].duration).to.eql(13);
|
||||
});
|
||||
|
||||
it("prevents firing movestart noMoveStart", function (done) {
|
||||
var movestartSpy = sinon.spy();
|
||||
map.on("movestart", movestartSpy);
|
||||
var moveendSpy = sinon.spy();
|
||||
map.on("moveend", moveendSpy);
|
||||
|
||||
map.setView([51.505, -0.09], 13, {pan: {noMoveStart: true}});
|
||||
|
||||
setTimeout(function () {
|
||||
expect(movestartSpy.notCalled).to.eql(true);
|
||||
expect(moveendSpy.calledOnce).to.eql(true);
|
||||
done();
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#getBounds", function () {
|
||||
|
Reference in New Issue
Block a user