Merge pull request #273 from twpayne/controls-api
reconsider the way we specify controls on the map
This commit is contained in:
@@ -235,6 +235,17 @@ describe('ol.collection', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('extending a collection', function() {
|
||||
it('adds elements to end of the collection', function() {
|
||||
collection.extend([1, 2]);
|
||||
expect(collection.getLength()).toEqual(2);
|
||||
expect(goog.array.equals(collection.getArray(), [1, 2])).toBeTruthy();
|
||||
expect(collection.getAt(0)).toEqual(1);
|
||||
expect(collection.getAt(1)).toEqual(2);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.array');
|
||||
|
||||
@@ -87,7 +87,7 @@ describe('ol.Map', function() {
|
||||
describe('create mousewheel interaction', function() {
|
||||
it('creates mousewheel interaction', function() {
|
||||
options.mouseWheelZoom = true;
|
||||
var interactions = ol.Map.createInteractions_(options);
|
||||
var interactions = ol.interaction.defaults(options);
|
||||
expect(interactions.getLength()).toEqual(1);
|
||||
expect(interactions.getAt(0)).toBeA(ol.interaction.MouseWheelZoom);
|
||||
});
|
||||
@@ -101,7 +101,7 @@ describe('ol.Map', function() {
|
||||
|
||||
describe('default zoomDelta', function() {
|
||||
it('create double click interaction with default delta', function() {
|
||||
var interactions = ol.Map.createInteractions_(options);
|
||||
var interactions = ol.interaction.defaults(options);
|
||||
expect(interactions.getLength()).toEqual(1);
|
||||
expect(interactions.getAt(0)).toBeA(ol.interaction.DblClickZoom);
|
||||
expect(interactions.getAt(0).delta_).toEqual(1);
|
||||
@@ -111,7 +111,7 @@ describe('ol.Map', function() {
|
||||
describe('set zoomDelta', function() {
|
||||
it('create double click interaction with set delta', function() {
|
||||
options.zoomDelta = 7;
|
||||
var interactions = ol.Map.createInteractions_(options);
|
||||
var interactions = ol.interaction.defaults(options);
|
||||
expect(interactions.getLength()).toEqual(1);
|
||||
expect(interactions.getAt(0)).toBeA(ol.interaction.DblClickZoom);
|
||||
expect(interactions.getAt(0).delta_).toEqual(7);
|
||||
@@ -233,5 +233,6 @@ goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.interaction.DblClickZoom');
|
||||
goog.require('ol.interaction.MouseWheelZoom');
|
||||
goog.require('ol.interaction.defaults');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
Reference in New Issue
Block a user