Test that an animation series works with an undefined view
This commit is contained in:
@@ -489,6 +489,31 @@ describe('ol.View', function() {
|
|||||||
expect(view.getRotation()).to.eql(rotation);
|
expect(view.getRotation()).to.eql(rotation);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('sets final animation state if view is not defined before', function() {
|
||||||
|
var view = new ol.View();
|
||||||
|
|
||||||
|
var center = [1, 2];
|
||||||
|
var zoom = 3;
|
||||||
|
var rotation = 0.4;
|
||||||
|
|
||||||
|
view.animate({
|
||||||
|
zoom: 1
|
||||||
|
}, {
|
||||||
|
center: [2, 3]
|
||||||
|
}, {
|
||||||
|
rotation: 4
|
||||||
|
}, {
|
||||||
|
zoom: zoom,
|
||||||
|
center: center,
|
||||||
|
rotation: rotation,
|
||||||
|
duration: 25
|
||||||
|
});
|
||||||
|
expect(view.getAnimating()).to.eql(false);
|
||||||
|
expect(view.getCenter()).to.eql(center);
|
||||||
|
expect(view.getZoom()).to.eql(zoom);
|
||||||
|
expect(view.getRotation()).to.eql(rotation);
|
||||||
|
});
|
||||||
|
|
||||||
it('prefers zoom over resolution', function(done) {
|
it('prefers zoom over resolution', function(done) {
|
||||||
var view = new ol.View({
|
var view = new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
Reference in New Issue
Block a user