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:
Chivano
2022-04-22 14:56:02 +02:00
committed by GitHub
parent 9e97c62a2f
commit cd0dcddecc
2 changed files with 18 additions and 3 deletions

View File

@ -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 () {