Rename _ol_View_ to View

This commit is contained in:
Tim Schaub
2018-01-08 09:59:44 -07:00
parent a04144c3c2
commit 1c1f008238
207 changed files with 559 additions and 559 deletions

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import TileLayer from '../../../../src/ol/layer/Tile.js';
import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
@@ -41,7 +41,7 @@ describe('layer clipping', function() {
map = new Map({
pixelRatio: 1,
target: createMapDiv(256, 256),
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
})

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_layer_Image_ from '../../../../src/ol/layer/Image.js';
import _ol_obj_ from '../../../../src/ol/obj.js';
import {get as getProjection, transform, transformExtent} from '../../../../src/ol/proj.js';
@@ -16,7 +16,7 @@ describe('ol.rendering.layer.Image', function() {
pixelRatio: 1,
target: createMapDiv(50, 50),
renderer: renderer,
view: new _ol_View_({
view: new View({
center: transform(
[-122.416667, 37.783333], 'EPSG:4326', 'EPSG:3857'),
zoom: 5

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import Point from '../../../../src/ol/geom/Point.js';
import TileLayer from '../../../../src/ol/layer/Tile.js';
@@ -24,7 +24,7 @@ describe('ol.rendering.layer.Tile', function() {
pixelRatio: opt_pixelRatio || 1,
target: createMapDiv(size[0], size[1]),
renderer: renderer,
view: new _ol_View_({
view: new View({
center: opt_center !== undefined ? opt_center : transform(
[-122.416667, 37.783333], 'EPSG:4326', 'EPSG:3857'),
resolutions: opt_resolutions,

View File

@@ -1,6 +1,6 @@
import Feature from '../../../../src/ol/Feature.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import GeoJSON from '../../../../src/ol/format/GeoJSON.js';
import Circle from '../../../../src/ol/geom/Circle.js';
import LineString from '../../../../src/ol/geom/LineString.js';
@@ -25,7 +25,7 @@ describe('ol.rendering.layer.Vector', function() {
pixelRatio: 1,
target: createMapDiv(80, 80),
renderer: renderer,
view: new _ol_View_({
view: new View({
center: center,
zoom: 13
})
@@ -434,7 +434,7 @@ describe('ol.rendering.layer.Vector', function() {
map2 = new Map({
pixelRatio: 1,
target: createMapDiv(128, 128),
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
})
@@ -514,7 +514,7 @@ describe('ol.rendering.layer.Vector', function() {
renderBuffer: 0,
source: src
});
var view = new _ol_View_({
var view = new View({
center: [-9.5, 78],
zoom: 2,
projection: 'EPSG:4326'

View File

@@ -1,6 +1,6 @@
import Feature from '../../../../src/ol/Feature.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import MVT from '../../../../src/ol/format/MVT.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
@@ -25,7 +25,7 @@ describe('ol.rendering.layer.VectorTile', function() {
pixelRatio: opt_pixelRatio || 1,
target: createMapDiv(size, size),
renderer: renderer,
view: new _ol_View_({
view: new View({
center: [1825927.7316762917, 6143091.089223046],
zoom: 14
})

View File

@@ -1,7 +1,7 @@
import Feature from '../../../src/ol/Feature.js';
import Point from '../../../src/ol/geom/Point.js';
import Map from '../../../src/ol/Map.js';
import _ol_View_ from '../../../src/ol/View.js';
import View from '../../../src/ol/View.js';
import _ol_layer_Vector_ from '../../../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../../../src/ol/source/Vector.js';
@@ -23,7 +23,7 @@ describe('ol.rendering.Map', function() {
target: createMapDiv(50, 50),
renderer: renderer,
layers: [vectorLayer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_layer_Image_ from '../../../../src/ol/layer/Image.js';
import RasterSource from '../../../../src/ol/source/Raster.js';
import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
@@ -32,7 +32,7 @@ where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() {
target: createMapDiv(200, 200),
pixelRatio: pixelRatio,
renderer: renderer,
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
})

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import TileLayer from '../../../../src/ol/layer/Tile.js';
import _ol_source_TileWMS_ from '../../../../src/ol/source/TileWMS.js';
@@ -29,7 +29,7 @@ describe('ol.rendering.source.TileWMS', function() {
target: createMapDiv(200, 200),
pixelRatio: pixelRatio,
renderer: renderer,
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 5
})

View File

@@ -2,7 +2,7 @@ import Feature from '../../../../src/ol/Feature.js';
import Point from '../../../../src/ol/geom/Point.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
@@ -26,7 +26,7 @@ describe('ol.rendering.style.Circle', function() {
target: createMapDiv(50, 50),
renderer: renderer,
layers: [vectorLayer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,7 +1,7 @@
import Feature from '../../../../src/ol/Feature.js';
import Point from '../../../../src/ol/geom/Point.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js';
@@ -32,7 +32,7 @@ describe('ol.rendering.style.Icon', function() {
target: createMapDiv(width ? width : 50, height ? height : 50),
renderer: renderer,
layers: [vectorLayer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,7 +1,7 @@
import Feature from '../../../../src/ol/Feature.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
@@ -23,7 +23,7 @@ describe('ol.rendering.style.LineString', function() {
target: createMapDiv(50, 50),
renderer: renderer,
layers: [vectorLayer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,7 +1,7 @@
import Feature from '../../../../src/ol/Feature.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
@@ -26,7 +26,7 @@ describe('ol.rendering.style.Polygon', function() {
target: createMapDiv(size, size),
renderer: renderer,
layers: [vectorLayer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,7 +1,7 @@
import Feature from '../../../../src/ol/Feature.js';
import Point from '../../../../src/ol/geom/Point.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
@@ -25,7 +25,7 @@ describe('ol.rendering.style.RegularShape', function() {
target: createMapDiv(50, 50),
renderer: renderer,
layers: [vectorLayer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -5,7 +5,7 @@ import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import Point from '../../../../src/ol/geom/Point.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
@@ -29,7 +29,7 @@ describe('ol.rendering.style.Text', function() {
target: createMapDiv(200 / pixelRatio, 200 / pixelRatio),
renderer: renderer,
layers: [vectorLayer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,6 +1,6 @@
import Map from '../../../../src/ol/Map.js';
import _ol_Tile_ from '../../../../src/ol/Tile.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Attribution from '../../../../src/ol/control/Attribution.js';
import TileLayer from '../../../../src/ol/layer/Tile.js';
import _ol_source_Tile_ from '../../../../src/ol/source/Tile.js';
@@ -42,7 +42,7 @@ describe('ol.control.Attribution', function() {
})
})
],
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
})

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Control from '../../../../src/ol/control/Control.js';
import OverviewMap from '../../../../src/ol/control/OverviewMap.js';
@@ -32,7 +32,7 @@ describe('ol.control.OverviewMap', function() {
describe('setMap()', function() {
it('keeps ovmap view rotation in sync with map view rotation', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0,
rotation: 0
@@ -54,7 +54,7 @@ describe('ol.control.OverviewMap', function() {
var ovView = control.ovmap_.getView();
expect(ovView.getRotation()).to.be(0);
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0,
rotation: 0
@@ -68,7 +68,7 @@ describe('ol.control.OverviewMap', function() {
var control = new OverviewMap();
var ovView = control.ovmap_.getView();
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0,
rotation: 0

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import ScaleLine from '../../../../src/ol/control/ScaleLine.js';
import {fromLonLat} from '../../../../src/ol/proj.js';
import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
@@ -91,7 +91,7 @@ describe('ol.control.ScaleLine', function() {
expect(renderSpy.called).to.be(false);
ctrl.setMap(map);
expect(renderSpy.called).to.be(false);
map.setView(new _ol_View_({
map.setView(new View({
center: [0, 0],
zoom: 0
}));
@@ -108,7 +108,7 @@ describe('ol.control.ScaleLine', function() {
render: renderSpy
});
ctrl.setMap(map);
map.setView(new _ol_View_({
map.setView(new View({
center: [0, 0],
zoom: 0
}));
@@ -125,7 +125,7 @@ describe('ol.control.ScaleLine', function() {
render: renderSpy
});
ctrl.setMap(map);
map.setView(new _ol_View_({
map.setView(new View({
center: [0, 0],
zoom: 0
}));
@@ -143,7 +143,7 @@ describe('ol.control.ScaleLine', function() {
var ctrl = new ScaleLine();
expect(ctrl.element.innerText).to.be('');
ctrl.setMap(map);
map.setView(new _ol_View_({
map.setView(new View({
center: [0, 0],
zoom: 0
}));
@@ -173,7 +173,7 @@ describe('ol.control.ScaleLine', function() {
describe('#setUnits', function() {
it('triggers rerendering', function() {
var ctrl = new ScaleLine();
map.setView(new _ol_View_({
map.setView(new View({
center: [0, 0],
zoom: 0
}));
@@ -198,7 +198,7 @@ describe('ol.control.ScaleLine', function() {
beforeEach(function(done) {
ctrl = new ScaleLine();
ctrl.setMap(map);
map.setView(new _ol_View_({
map.setView(new View({
center: [0, 0],
zoom: 0
}));
@@ -248,14 +248,14 @@ describe('ol.control.ScaleLine', function() {
it('is rendered differently for different projections', function() {
var ctrl = new ScaleLine();
ctrl.setMap(map);
map.setView(new _ol_View_({
map.setView(new View({
center: fromLonLat([7, 52]),
zoom: 2,
projection: 'EPSG:3857'
}));
map.renderSync();
var innerHtml3857 = ctrl.element_.innerHTML;
map.setView(new _ol_View_({
map.setView(new View({
center: [7, 52],
zoom: 2,
projection: 'EPSG:4326'
@@ -268,7 +268,7 @@ describe('ol.control.ScaleLine', function() {
it('Projection\'s metersPerUnit affect scale for non-degree units', function() {
var ctrl = new ScaleLine();
ctrl.setMap(map);
map.setView(new _ol_View_({
map.setView(new View({
center: [0, 0],
zoom: 0,
resolutions: [1],
@@ -282,7 +282,7 @@ describe('ol.control.ScaleLine', function() {
}));
map.renderSync();
expect(ctrl.element_.innerText).to.be('100 m');
map.setView(new _ol_View_({
map.setView(new View({
center: [0, 0],
zoom: 0,
resolutions: [1],
@@ -305,7 +305,7 @@ describe('ol.control.ScaleLine', function() {
it('is rendered differently at different latitudes for metric', function() {
var ctrl = new ScaleLine();
ctrl.setMap(map);
map.setView(new _ol_View_({
map.setView(new View({
center: fromLonLat([7, 0]),
zoom: 2,
projection: 'EPSG:4326'
@@ -323,7 +323,7 @@ describe('ol.control.ScaleLine', function() {
units: 'degrees'
});
ctrl.setMap(map);
map.setView(new _ol_View_({
map.setView(new View({
center: fromLonLat([7, 0]),
zoom: 2,
projection: 'EPSG:4326'
@@ -363,7 +363,7 @@ describe('ol.control.ScaleLine', function() {
minWidth: 10
});
ctrl.setMap(map);
map.setView(new _ol_View_({
map.setView(new View({
center: [0, 0],
zoom: currentZoom,
maxZoom: currentZoom

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import ZoomSlider from '../../../../src/ol/control/ZoomSlider.js';
import _ol_pointer_PointerEvent_ from '../../../../src/ol/pointer/PointerEvent.js';
@@ -91,7 +91,7 @@ describe('ol.control.ZoomSlider', function() {
beforeEach(function() {
map = new Map({
target: createMapDiv(500, 100),
view: new _ol_View_({
view: new View({
center: [0, 0],
resolutions: [16, 8, 4, 2, 1, 0.5, 0.25, 0.125, 0.0625]
})

View File

@@ -1,5 +1,5 @@
import {inherits} from '../../../../src/ol/index.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Event from '../../../../src/ol/events/Event.js';
import EventTarget from '../../../../src/ol/events/EventTarget.js';
import GeoJSON from '../../../../src/ol/format/GeoJSON.js';
@@ -16,7 +16,7 @@ where('FileReader').describe('ol.interaction.DragAndDrop', function() {
return viewport;
},
getView: function() {
return new _ol_View_();
return new View();
}
};
interaction = new DragAndDrop({

View File

@@ -1,6 +1,6 @@
import Map from '../../../../src/ol/Map.js';
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import DragRotateAndZoom from '../../../../src/ol/interaction/DragRotateAndZoom.js';
import Interaction from '../../../../src/ol/interaction/Interaction.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
@@ -41,7 +41,7 @@ describe('ol.interaction.DragRotateAndZoom', function() {
target: target,
layers: [layer],
interactions: [interaction],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1
@@ -66,7 +66,7 @@ describe('ol.interaction.DragRotateAndZoom', function() {
interaction.handleDragEvent_(event);
expect(spy.callCount).to.be(1);
expect(interaction.lastAngle_).to.be(-0.8308214428190254);
map.setView(new _ol_View_({
map.setView(new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1,

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import {fromExtent as polygonFromExtent} from '../../../../src/ol/geom/Polygon.js';
import DragZoom from '../../../../src/ol/interaction/DragZoom.js';
@@ -29,7 +29,7 @@ describe('ol.interaction.DragZoom', function() {
map = new Map({
target: target,
layers: [layer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,7 +1,7 @@
import Feature from '../../../../src/ol/Feature.js';
import Map from '../../../../src/ol/Map.js';
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import {equals} from '../../../../src/ol/array.js';
import _ol_events_ from '../../../../src/ol/events.js';
import _ol_events_condition_ from '../../../../src/ol/events/condition.js';
@@ -39,7 +39,7 @@ describe('ol.interaction.Draw', function() {
map = new Map({
target: target,
layers: [layer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,6 +1,6 @@
import Map from '../../../../src/ol/Map.js';
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_interaction_Extent_ from '../../../../src/ol/interaction/Extent.js';
import _ol_pointer_PointerEvent_ from '../../../../src/ol/pointer/PointerEvent.js';
@@ -16,7 +16,7 @@ describe('ol.interaction.Extent', function() {
map = new Map({
target: target,
layers: [],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import EventTarget from '../../../../src/ol/events/EventTarget.js';
import Interaction from '../../../../src/ol/interaction/Interaction.js';
@@ -59,7 +59,7 @@ describe('ol.interaction.Interaction', function() {
describe('zoomByDelta()', function() {
it('changes view resolution', function() {
var view = new _ol_View_({
var view = new View({
resolution: 1,
resolutions: [4, 2, 1, 0.5, 0.25]
});
@@ -78,7 +78,7 @@ describe('ol.interaction.Interaction', function() {
});
it('changes view resolution and center relative to the anchor', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
resolution: 1,
resolutions: [4, 2, 1, 0.5, 0.25]
@@ -98,7 +98,7 @@ describe('ol.interaction.Interaction', function() {
});
it('changes view resolution and center relative to the anchor, while respecting the extent', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
extent: [-2.5, -2.5, 2.5, 2.5],
resolution: 1,

View File

@@ -1,6 +1,6 @@
import Map from '../../../../src/ol/Map.js';
import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Event from '../../../../src/ol/events/Event.js';
import Interaction from '../../../../src/ol/interaction/Interaction.js';
@@ -10,7 +10,7 @@ describe('ol.interaction.KeyboardPan', function() {
beforeEach(function() {
map = new Map({
target: createMapDiv(100, 100),
view: new _ol_View_({
view: new View({
center: [0, 0],
resolutions: [1],
zoom: 0

View File

@@ -1,6 +1,6 @@
import Map from '../../../../src/ol/Map.js';
import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Event from '../../../../src/ol/events/Event.js';
import Interaction from '../../../../src/ol/interaction/Interaction.js';
@@ -10,7 +10,7 @@ describe('ol.interaction.KeyboardZoom', function() {
beforeEach(function() {
map = new Map({
target: createMapDiv(100, 100),
view: new _ol_View_({
view: new View({
center: [0, 0],
resolutions: [1],
zoom: 0

View File

@@ -2,7 +2,7 @@ import _ol_Collection_ from '../../../../src/ol/Collection.js';
import Feature from '../../../../src/ol/Feature.js';
import Map from '../../../../src/ol/Map.js';
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_events_ from '../../../../src/ol/events.js';
import _ol_events_condition_ from '../../../../src/ol/events/condition.js';
import Circle from '../../../../src/ol/geom/Circle.js';
@@ -50,7 +50,7 @@ describe('ol.interaction.Modify', function() {
map = new Map({
target: target,
layers: [layer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,6 +1,6 @@
import Map from '../../../../src/ol/Map.js';
import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Event from '../../../../src/ol/events/Event.js';
import _ol_has_ from '../../../../src/ol/has.js';
import Interaction from '../../../../src/ol/interaction/Interaction.js';
@@ -15,7 +15,7 @@ describe('ol.interaction.MouseWheelZoom', function() {
map = new Map({
target: createMapDiv(100, 100),
interactions: [interaction],
view: new _ol_View_({
view: new View({
center: [0, 0],
resolutions: [2, 1, 0.5],
zoom: 1

View File

@@ -3,7 +3,7 @@ import Feature from '../../../../src/ol/Feature.js';
import Map from '../../../../src/ol/Map.js';
import MapBrowserEventType from '../../../../src/ol/MapBrowserEventType.js';
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import Interaction from '../../../../src/ol/interaction/Interaction.js';
import _ol_interaction_Select_ from '../../../../src/ol/interaction/Select.js';
@@ -62,7 +62,7 @@ describe('ol.interaction.Select', function() {
map = new Map({
target: target,
layers: [layer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,7 +1,7 @@
import _ol_Collection_ from '../../../../src/ol/Collection.js';
import Feature from '../../../../src/ol/Feature.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Circle from '../../../../src/ol/geom/Circle.js';
import Point from '../../../../src/ol/geom/Point.js';
import LineString from '../../../../src/ol/geom/LineString.js';
@@ -38,7 +38,7 @@ describe('ol.interaction.Snap', function() {
map = new Map({
target: target,
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -2,7 +2,7 @@ import _ol_Collection_ from '../../../../src/ol/Collection.js';
import Feature from '../../../../src/ol/Feature.js';
import Map from '../../../../src/ol/Map.js';
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_interaction_Translate_ from '../../../../src/ol/interaction/Translate.js';
import Interaction from '../../../../src/ol/interaction/Interaction.js';
@@ -37,7 +37,7 @@ describe('ol.interaction.Translate', function() {
map = new Map({
target: target,
layers: [layer],
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -2,7 +2,7 @@ import Feature from '../../../src/ol/Feature.js';
import Map from '../../../src/ol/Map.js';
import MapEvent from '../../../src/ol/MapEvent.js';
import Overlay from '../../../src/ol/Overlay.js';
import _ol_View_ from '../../../src/ol/View.js';
import View from '../../../src/ol/View.js';
import LineString from '../../../src/ol/geom/LineString.js';
import _ol_has_ from '../../../src/ol/has.js';
import {defaults as defaultInteractions} from '../../../src/ol/interaction.js';
@@ -117,7 +117,7 @@ describe('ol.Map', function() {
style.height = '180px';
document.body.appendChild(target);
view = new _ol_View_({
view = new View({
projection: 'EPSG:4326'
});
map = new Map({
@@ -200,7 +200,7 @@ describe('ol.Map', function() {
features: [new Feature(new LineString([[-50, 0], [50, 0]]))]
})
})],
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 17
})
@@ -273,7 +273,7 @@ describe('ol.Map', function() {
map = new Map({
target: target,
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 1
}),
@@ -328,7 +328,7 @@ describe('ol.Map', function() {
document.body.appendChild(target);
map = new Map({
target: target,
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1
@@ -608,7 +608,7 @@ describe('ol.Map', function() {
document.body.appendChild(target);
map = new Map({
target: target,
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,6 +1,6 @@
import Map from '../../../src/ol/Map.js';
import Overlay from '../../../src/ol/Overlay.js';
import _ol_View_ from '../../../src/ol/View.js';
import View from '../../../src/ol/View.js';
describe('ol.Overlay', function() {
@@ -22,7 +22,7 @@ describe('ol.Overlay', function() {
map = new Map({
target: target,
view: new _ol_View_({
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1

View File

@@ -1,6 +1,6 @@
import Disposable from '../../../../src/ol/Disposable.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import _ol_render_Box_ from '../../../../src/ol/render/Box.js';
@@ -17,7 +17,7 @@ describe('ol.render.Box', function() {
map = new Map({
target: target,
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
})

View File

@@ -1,5 +1,5 @@
import Map from '../../../../../src/ol/Map.js';
import _ol_View_ from '../../../../../src/ol/View.js';
import View from '../../../../../src/ol/View.js';
import _ol_layer_Image_ from '../../../../../src/ol/layer/Image.js';
import _ol_proj_Projection_ from '../../../../../src/ol/proj/Projection.js';
import _ol_source_ImageStatic_ from '../../../../../src/ol/source/ImageStatic.js';
@@ -31,7 +31,7 @@ describe('ol.renderer.canvas.ImageLayer', function() {
layers: [new _ol_layer_Image_({
source: source
})],
view: new _ol_View_({
view: new View({
projection: projection,
center: [10, 10],
zoom: 2,

View File

@@ -1,7 +1,7 @@
import {getUid} from '../../../../../src/ol/index.js';
import Feature from '../../../../../src/ol/Feature.js';
import Map from '../../../../../src/ol/Map.js';
import _ol_View_ from '../../../../../src/ol/View.js';
import View from '../../../../../src/ol/View.js';
import Point from '../../../../../src/ol/geom/Point.js';
import TileLayer from '../../../../../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../../../../../src/ol/layer/Vector.js';
@@ -37,7 +37,7 @@ describe('ol.renderer.canvas.Map', function() {
map = new Map({
pixelRatio: 1,
target: target,
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
})

View File

@@ -1,5 +1,5 @@
import Map from '../../../../../src/ol/Map.js';
import _ol_View_ from '../../../../../src/ol/View.js';
import View from '../../../../../src/ol/View.js';
import TileLayer from '../../../../../src/ol/layer/Tile.js';
import {get as getProjection} from '../../../../../src/ol/proj.js';
import _ol_renderer_Map_ from '../../../../../src/ol/renderer/Map.js';
@@ -32,7 +32,7 @@ describe('ol.renderer.canvas.TileLayer', function() {
layers: [new TileLayer({
source: source
})],
view: new _ol_View_({
view: new View({
zoom: 0,
center: [0, 0]
})

View File

@@ -1,7 +1,7 @@
import {getUid} from '../../../../../src/ol/index.js';
import Feature from '../../../../../src/ol/Feature.js';
import Map from '../../../../../src/ol/Map.js';
import _ol_View_ from '../../../../../src/ol/View.js';
import View from '../../../../../src/ol/View.js';
import * as _ol_extent_ from '../../../../../src/ol/extent.js';
import Point from '../../../../../src/ol/geom/Point.js';
import _ol_layer_Vector_ from '../../../../../src/ol/layer/Vector.js';
@@ -50,7 +50,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
target.style.height = '256px';
document.body.appendChild(target);
var map = new Map({
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
}),
@@ -87,7 +87,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
it('does not re-render for unavailable fonts', function(done) {
_ol_obj_.clear(_ol_render_canvas_.checkedFonts_);
var map = new Map({
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
}),
@@ -118,7 +118,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
it('does not re-render for available fonts', function(done) {
_ol_obj_.clear(_ol_render_canvas_.checkedFonts_);
var map = new Map({
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
}),
@@ -150,7 +150,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
_ol_obj_.clear(_ol_render_canvas_.checkedFonts_);
head.appendChild(font);
var map = new Map({
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
}),

View File

@@ -5,7 +5,7 @@ import Map from '../../../../../src/ol/Map.js';
import TileState from '../../../../../src/ol/TileState.js';
import VectorImageTile from '../../../../../src/ol/VectorImageTile.js';
import VectorTile from '../../../../../src/ol/VectorTile.js';
import _ol_View_ from '../../../../../src/ol/View.js';
import View from '../../../../../src/ol/View.js';
import * as _ol_extent_ from '../../../../../src/ol/extent.js';
import MVT from '../../../../../src/ol/format/MVT.js';
import Point from '../../../../../src/ol/geom/Point.js';
@@ -39,7 +39,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
target.style.height = '256px';
document.body.appendChild(target);
map = new Map({
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
}),
@@ -363,7 +363,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
source: source
})
],
view: new _ol_View_({
view: new View({
center: _ol_extent_.getCenter(extent),
zoom: 19
})

View File

@@ -1,6 +1,6 @@
import _ol_Image_ from '../../../../src/ol/Image.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_layer_Layer_ from '../../../../src/ol/layer/Layer.js';
import TileLayer from '../../../../src/ol/layer/Tile.js';
import _ol_renderer_Layer_ from '../../../../src/ol/renderer/Layer.js';
@@ -98,7 +98,7 @@ describe('ol.renderer.Layer', function() {
});
document.body.appendChild(target);
view = new _ol_View_({
view = new View({
center: [0, 0],
zoom: 0
});

View File

@@ -1,6 +1,6 @@
import Map from '../../../../src/ol/Map.js';
import TileState from '../../../../src/ol/TileState.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import _ol_layer_Image_ from '../../../../src/ol/layer/Image.js';
import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
import _ol_source_ImageStatic_ from '../../../../src/ol/source/ImageStatic.js';
@@ -60,7 +60,7 @@ where('Uint8ClampedArray').describe('ol.source.Raster', function() {
map = new Map({
target: target,
view: new _ol_View_({
view: new View({
resolutions: [1],
projection: new _ol_proj_Projection_({
code: 'image',
@@ -325,7 +325,7 @@ where('Uint8ClampedArray').describe('ol.source.Raster', function() {
map2 = new Map({
target: target,
view: new _ol_View_({
view: new View({
center: [0, 0],
zoom: 0
}),

View File

@@ -2,7 +2,7 @@ import _ol_events_ from '../../../../src/ol/events.js';
import _ol_Collection_ from '../../../../src/ol/Collection.js';
import Feature from '../../../../src/ol/Feature.js';
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import Point from '../../../../src/ol/geom/Point.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
@@ -445,7 +445,7 @@ describe('ol.source.Vector', function() {
source: source
})
],
view: new _ol_View_({
view: new View({
center: fromLonLat(center),
zoom: 7
})

View File

@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import View from '../../../../src/ol/View.js';
import VectorImageTile from '../../../../src/ol/VectorImageTile.js';
import VectorTile from '../../../../src/ol/VectorTile.js';
import MVT from '../../../../src/ol/format/MVT.js';
@@ -117,7 +117,7 @@ describe('ol.source.VectorTile', function() {
})
],
target: target,
view: new _ol_View_({
view: new View({
zoom: 11,
center: [666373.1624999996, 7034265.3572]
})

View File

@@ -1,5 +1,5 @@
import Map from '../../../src/ol/Map.js';
import _ol_View_ from '../../../src/ol/View.js';
import View from '../../../src/ol/View.js';
import ViewHint from '../../../src/ol/ViewHint.js';
import * as _ol_extent_ from '../../../src/ol/extent.js';
import Circle from '../../../src/ol/geom/Circle.js';
@@ -12,11 +12,11 @@ describe('ol.View', function() {
var view;
beforeEach(function() {
view = new _ol_View_();
view = new View();
});
it('creates an instance', function() {
expect(view).to.be.a(_ol_View_);
expect(view).to.be.a(View);
});
it('provides default rotation', function() {
@@ -32,7 +32,7 @@ describe('ol.View', function() {
describe('with no options', function() {
it('gives a correct center constraint function', function() {
var options = {};
var fn = _ol_View_.createCenterConstraint_(options);
var fn = View.createCenterConstraint_(options);
expect(fn([0, 0])).to.eql([0, 0]);
expect(fn(undefined)).to.eql(undefined);
expect(fn([42, -100])).to.eql([42, -100]);
@@ -44,7 +44,7 @@ describe('ol.View', function() {
var options = {
extent: [0, 0, 1, 1]
};
var fn = _ol_View_.createCenterConstraint_(options);
var fn = View.createCenterConstraint_(options);
expect(fn([0, 0])).to.eql([0, 0]);
expect(fn([-10, 0])).to.eql([0, 0]);
expect(fn([100, 100])).to.eql([1, 1]);
@@ -58,7 +58,7 @@ describe('ol.View', function() {
describe('with no options', function() {
it('gives a correct resolution constraint function', function() {
var options = {};
var fn = _ol_View_.createResolutionConstraint_(options).constraint;
var fn = View.createResolutionConstraint_(options).constraint;
expect(fn(156543.03392804097, 0, 0))
.to.roughlyEqual(156543.03392804097, 1e-9);
expect(fn(78271.51696402048, 0, 0))
@@ -74,7 +74,7 @@ describe('ol.View', function() {
maxZoom: 3,
zoomFactor: 3
};
var info = _ol_View_.createResolutionConstraint_(options);
var info = View.createResolutionConstraint_(options);
var maxResolution = info.maxResolution;
expect(maxResolution).to.eql(81);
var minResolution = info.minResolution;
@@ -94,7 +94,7 @@ describe('ol.View', function() {
var options = {
resolutions: [97, 76, 65, 54, 0.45]
};
var info = _ol_View_.createResolutionConstraint_(options);
var info = View.createResolutionConstraint_(options);
var maxResolution = info.maxResolution;
expect(maxResolution).to.eql(97);
var minResolution = info.minResolution;
@@ -112,7 +112,7 @@ describe('ol.View', function() {
var defaultMaxRes = 156543.03392804097;
function getConstraint(options) {
return _ol_View_.createResolutionConstraint_(options).constraint;
return View.createResolutionConstraint_(options).constraint;
}
it('works with only maxZoom', function() {
@@ -179,7 +179,7 @@ describe('ol.View', function() {
var defaultMaxRes = 156543.03392804097;
function getConstraint(options) {
return _ol_View_.createResolutionConstraint_(options).constraint;
return View.createResolutionConstraint_(options).constraint;
}
it('works with only maxResolution', function() {
@@ -248,7 +248,7 @@ describe('ol.View', function() {
var defaultMaxRes = 156543.03392804097;
function getConstraint(options) {
return _ol_View_.createResolutionConstraint_(options).constraint;
return View.createResolutionConstraint_(options).constraint;
}
it('respects maxResolution over minZoom', function() {
@@ -292,7 +292,7 @@ describe('ol.View', function() {
describe('create rotation constraint', function() {
it('gives a correct rotation constraint function', function() {
var options = {};
var fn = _ol_View_.createRotationConstraint_(options);
var fn = View.createRotationConstraint_(options);
expect(fn(0.01, 0)).to.eql(0);
expect(fn(0.15, 0)).to.eql(0.15);
});
@@ -303,7 +303,7 @@ describe('ol.View', function() {
describe('#setHint()', function() {
it('changes a view hint', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0
});
@@ -317,7 +317,7 @@ describe('ol.View', function() {
});
it('triggers the change event', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0
});
@@ -335,7 +335,7 @@ describe('ol.View', function() {
describe('#getUpdatedOptions_()', function() {
it('applies minZoom to constructor options', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
minZoom: 2,
zoom: 10
@@ -348,7 +348,7 @@ describe('ol.View', function() {
});
it('applies the current zoom', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 10
});
@@ -360,7 +360,7 @@ describe('ol.View', function() {
});
it('applies the current resolution if resolution was originally supplied', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
resolution: 1000
});
@@ -372,7 +372,7 @@ describe('ol.View', function() {
});
it('applies the current center', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 10
});
@@ -384,7 +384,7 @@ describe('ol.View', function() {
});
it('applies the current rotation', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 10
});
@@ -418,7 +418,7 @@ describe('ol.View', function() {
});
it('can be called to animate view properties', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 5
});
@@ -438,7 +438,7 @@ describe('ol.View', function() {
});
it('allows duration to be zero', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 5
});
@@ -457,7 +457,7 @@ describe('ol.View', function() {
});
it('immediately completes for no-op animations', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 5
});
@@ -471,7 +471,7 @@ describe('ol.View', function() {
});
it('immediately completes if view is not defined before', function() {
var view = new _ol_View_();
var view = new View();
var center = [1, 2];
var zoom = 3;
var rotation = 0.4;
@@ -489,7 +489,7 @@ describe('ol.View', function() {
});
it('sets final animation state if view is not defined before', function() {
var view = new _ol_View_();
var view = new View();
var center = [1, 2];
var zoom = 3;
@@ -514,7 +514,7 @@ describe('ol.View', function() {
});
it('prefers zoom over resolution', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 5
});
@@ -532,7 +532,7 @@ describe('ol.View', function() {
it('avoids going under minResolution', function(done) {
var maxZoom = 14;
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0,
maxZoom: maxZoom
@@ -551,7 +551,7 @@ describe('ol.View', function() {
});
it('takes the shortest arc to the target rotation', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0,
rotation: Math.PI / 180 * 1
@@ -566,7 +566,7 @@ describe('ol.View', function() {
});
it('normalizes rotation to angles between -180 and 180 degrees after the anmiation', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0,
rotation: Math.PI / 180 * 1
@@ -581,7 +581,7 @@ describe('ol.View', function() {
});
it('calls a callback when animation completes', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0
});
@@ -596,7 +596,7 @@ describe('ol.View', function() {
});
it('calls callback with false when animation is interrupted', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0
});
@@ -613,7 +613,7 @@ describe('ol.View', function() {
});
it('calls a callback even if animation is a no-op', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0
});
@@ -628,7 +628,7 @@ describe('ol.View', function() {
});
it('calls a callback if view is not defined before', function(done) {
var view = new _ol_View_();
var view = new View();
view.animate({
zoom: 10,
@@ -641,7 +641,7 @@ describe('ol.View', function() {
});
it('can run multiple animations in series', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0
});
@@ -670,7 +670,7 @@ describe('ol.View', function() {
});
it('properly sets the ANIMATING hint', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0,
rotation: 0
@@ -705,7 +705,7 @@ describe('ol.View', function() {
});
it('clears the ANIMATING hint when animations are cancelled', function() {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0,
rotation: 0
@@ -737,7 +737,7 @@ describe('ol.View', function() {
it('completes multiple staggered animations run in parallel', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0
});
@@ -770,7 +770,7 @@ describe('ol.View', function() {
it('completes complex animation using resolution', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
resolution: 2
});
@@ -841,7 +841,7 @@ describe('ol.View', function() {
});
it('cancels a currently running animation', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0,
rotation: 0
@@ -863,7 +863,7 @@ describe('ol.View', function() {
});
it('cancels a multiple animations', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0,
rotation: 0
@@ -893,7 +893,7 @@ describe('ol.View', function() {
});
it('calls callbacks with false to indicate animations did not complete', function(done) {
var view = new _ol_View_({
var view = new View({
center: [0, 0],
zoom: 0
});
@@ -920,14 +920,14 @@ describe('ol.View', function() {
var resolutions = [512, 256, 128, 64, 32, 16];
it('returns correct resolutions', function() {
view = new _ol_View_({
view = new View({
resolutions: resolutions
});
expect(view.getResolutions()).to.be(resolutions);
});
it('returns resolutions as undefined', function() {
view = new _ol_View_();
view = new View();
expect(view.getResolutions()).to.be(undefined);
});
});
@@ -935,7 +935,7 @@ describe('ol.View', function() {
describe('#getZoom', function() {
var view;
beforeEach(function() {
view = new _ol_View_({
view = new View({
resolutions: [512, 256, 128, 64, 32, 16]
});
});
@@ -967,7 +967,7 @@ describe('ol.View', function() {
});
it('works for resolution arrays with variable zoom factors', function() {
var view = new _ol_View_({
var view = new View({
resolutions: [10, 5, 2, 1]
});
@@ -991,7 +991,7 @@ describe('ol.View', function() {
describe('#getZoom() - constrained', function() {
it('returns correct zoom levels', function() {
var view = new _ol_View_({
var view = new View({
minZoom: 10,
maxZoom: 20
});
@@ -1020,7 +1020,7 @@ describe('ol.View', function() {
it('gives maxResolution precedence over minZoom', function() {
var view = new _ol_View_({
var view = new View({
maxResolution: 100,
minZoom: 2 // this should get ignored
});
@@ -1036,7 +1036,7 @@ describe('ol.View', function() {
describe('#getZoomForResolution', function() {
it('returns correct zoom levels', function() {
var view = new _ol_View_();
var view = new View();
var max = view.getMaxResolution();
expect(view.getZoomForResolution(max)).to.be(0);
@@ -1049,7 +1049,7 @@ describe('ol.View', function() {
});
it('returns correct zoom levels for specifically configured resolutions', function() {
var view = new _ol_View_({
var view = new View({
resolutions: [10, 8, 6, 4, 2]
});
@@ -1069,7 +1069,7 @@ describe('ol.View', function() {
describe('#getResolutionForZoom', function() {
it('returns correct zoom resolution', function() {
var view = new _ol_View_();
var view = new View();
var max = view.getMaxZoom();
var min = view.getMinZoom();
@@ -1078,7 +1078,7 @@ describe('ol.View', function() {
});
it('returns correct zoom levels for specifically configured resolutions', function() {
var view = new _ol_View_({
var view = new View({
resolutions: [10, 8, 6, 4, 2]
});
@@ -1094,12 +1094,12 @@ describe('ol.View', function() {
describe('#getMaxZoom', function() {
it('returns the zoom level for the min resolution', function() {
var view = new _ol_View_();
var view = new View();
expect(view.getMaxZoom()).to.be(view.getZoomForResolution(view.getMinResolution()));
});
it('works for a view configured with a maxZoom', function() {
var view = new _ol_View_({
var view = new View({
maxZoom: 10
});
expect(view.getMaxZoom()).to.be(10);
@@ -1110,12 +1110,12 @@ describe('ol.View', function() {
describe('#getMinZoom', function() {
it('returns the zoom level for the max resolution', function() {
var view = new _ol_View_();
var view = new View();
expect(view.getMinZoom()).to.be(view.getZoomForResolution(view.getMaxResolution()));
});
it('works for views configured with a minZoom', function() {
var view = new _ol_View_({
var view = new View({
minZoom: 3
});
expect(view.getMinZoom()).to.be(3);
@@ -1126,7 +1126,7 @@ describe('ol.View', function() {
describe('#setMaxZoom', function() {
describe('with resolutions property in view', function() {
it('changes the zoom level when the level is over max zoom', function() {
var view = new _ol_View_({
var view = new View({
resolutions: [100000, 50000, 25000, 12500, 6250, 3125],
zoom: 4
});
@@ -1138,7 +1138,7 @@ describe('ol.View', function() {
describe('with no resolutions property in view', function() {
it('changes the zoom level when the level is over max zoom', function() {
var view = new _ol_View_({
var view = new View({
zoom: 4
});
@@ -1151,7 +1151,7 @@ describe('ol.View', function() {
describe('#setMinZoom', function() {
describe('with resolutions property in view', function() {
it('changes the zoom level when the level is under min zoom', function() {
var view = new _ol_View_({
var view = new View({
resolutions: [100000, 50000, 25000, 12500, 6250, 3125],
zoom: 4
});
@@ -1163,7 +1163,7 @@ describe('ol.View', function() {
describe('with no resolutions property in view', function() {
it('changes the zoom level when the level is under min zoom', function() {
var view = new _ol_View_({
var view = new View({
zoom: 4
});
@@ -1175,7 +1175,7 @@ describe('ol.View', function() {
describe('#calculateExtent', function() {
it('returns the expected extent', function() {
var view = new _ol_View_({
var view = new View({
resolutions: [512],
zoom: 0,
center: [0, 0]
@@ -1188,7 +1188,7 @@ describe('ol.View', function() {
expect(extent[3]).to.be(51200);
});
it('returns the expected extent with rotation', function() {
var view = new _ol_View_({
var view = new View({
resolutions: [512],
zoom: 0,
center: [0, 0],
@@ -1244,7 +1244,7 @@ describe('ol.View', function() {
var view;
beforeEach(function() {
view = new _ol_View_({
view = new View({
center: [0, 0],
resolutions: [200, 100, 50, 20, 10, 5, 2, 1],
zoom: 5
@@ -1370,7 +1370,7 @@ describe('ol.View', function() {
describe('centerOn', function() {
var view;
beforeEach(function() {
view = new _ol_View_({
view = new View({
resolutions: [200, 100, 50, 20, 10, 5, 2, 1]
});
});
@@ -1460,7 +1460,7 @@ describe('ol.View.isNoopAnimation()', function() {
cases.forEach(function(c, i) {
it('works for case ' + i, function() {
var noop = _ol_View_.isNoopAnimation(c.animation);
var noop = View.isNoopAnimation(c.animation);
expect(noop).to.equal(c.noop);
});
});