Merge pull request #273 from twpayne/controls-api

reconsider the way we specify controls on the map
This commit is contained in:
Tom Payne
2013-03-06 05:59:31 -08:00
16 changed files with 274 additions and 221 deletions

View File

@@ -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');

View File

@@ -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');