diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 7672d93e9a..52af5ea650 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -93,6 +93,10 @@ var tileUrlFunction = function(tileCoord, pixelRatio, projection) { The replacement of `ol.tilegrid.Zoomify` is a plain `ol.tilegrid.TileGrid`, configured with `extent`, `origin` and `resolutions`. If the `size` passed to the `ol.source.Zoomify` source is `[width, height]`, then the extent for the tile grid will be `[0, -height, width, 0]`, and the origin will be `[0, 0]`. +#### Replace `ol.View.fitExtent()` and `ol.View.fitGeometry()` with `ol.View.fit()` +* This combines two previously distinct functions into one more flexible call which takes either a geometry or an extent. +* Rename all calls to `fitExtent` and `fitGeometry` to `fit`. + ### v3.6.0 #### `ol.interaction.Draw` changes @@ -100,10 +104,6 @@ The replacement of `ol.tilegrid.Zoomify` is a plain `ol.tilegrid.TileGrid`, conf * The `minPointsPerRing` config option has been renamed to `minPoints`. It is now also available for linestring drawing, not only for polygons. * The `ol.DrawEvent` and `ol.DrawEventType` types were renamed to `ol.interaction.DrawEvent` and `ol.interaction.DrawEventType`. This has an impact on your code only if your code is compiled together with ol3. -#### Replace `ol.View.fitExtent()` and `ol.View.fitGeometry()` with `ol.View.fit()` -* This combines two previously distinct functions into one more flexible call which takes either a geometry or an extent. -* Rename all calls to `fitExtent` and `fitGeometry` to `fit`. - #### `ol.tilegrid` changes * The `ol.tilegrid.XYZ` constructor has been replaced by a static `ol.tilegrid.createXYZ()` function. The `ol.tilegrid.createXYZ()` function takes the same arguments as the previous `ol.tilegrid.XYZ` constructor, but returns an `ol.tilegrid.TileGrid` instance. diff --git a/src/ol/view.js b/src/ol/view.js index 80ab2d042f..db4dd8a79f 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -436,9 +436,9 @@ ol.View.prototype.getZoom = function() { /** * Fit the given geometry or extent based on the given map size and border. - * The size is pixel deminsions of the box to fit the extent into. + * The size is pixel dimensions of the box to fit the extent into. * In most cases you will want to use the map size, that is `map.getSize()`. - * Take care on the map angle. + * Takes care of the map angle. * @param {ol.geom.SimpleGeometry|ol.Extent} geometry Geometry. * @param {ol.Size} size Box pixel size. * @param {olx.view.FitOptions=} opt_options Options. diff --git a/test/spec/ol/view.test.js b/test/spec/ol/view.test.js index a1061f2cea..b4ef6bd69b 100644 --- a/test/spec/ol/view.test.js +++ b/test/spec/ol/view.test.js @@ -365,7 +365,7 @@ describe('ol.View', function() { }); describe('#calculateExtent', function() { - it('returns the expect extent', function() { + it('returns the expected extent', function() { var view = new ol.View({ resolutions: [512], zoom: 0, @@ -400,7 +400,7 @@ describe('ol.View', function() { resolutions: [200, 100, 50, 20, 10, 5, 2, 1] }); }); - it('fit correctly to the geometry', function() { + it('fits correctly to the geometry', function() { view.fit( new ol.geom.LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), [200, 200],