diff --git a/examples/wms-custom-proj.js b/examples/wms-custom-proj.js index 19d03ca493..6aae577534 100644 --- a/examples/wms-custom-proj.js +++ b/examples/wms-custom-proj.js @@ -19,19 +19,6 @@ var epsg21781 = new ol.Projection('EPSG:21781', ol.ProjectionUnits.METERS, new ol.Extent(485869.5728, 76443.1884, 837076.5648, 299941.7864)); ol.projection.addProjection(epsg21781); -// We could give the single image source a set of resolutions. This prevents the -// source from requesting images of arbitrary resolutions. To try it, uncomment -// the block below and the resolutions option in the SingleImageWMS config. -/* -var projectionExtent = epsg21781.getExtent(); -var maxResolution = Math.max(projectionExtent.getWidth(), - projectionExtent.getHeight()) / 256; -var resolutions = new Array(10); -for (var i = 0; i < 10; ++i) { - resolutions[i] = maxResolution / Math.pow(2.0, i); -} -*/ - var extent = new ol.Extent(420000, 30000, 900000, 350000); var layers = new ol.Collection([ new ol.layer.TileLayer({ @@ -50,7 +37,6 @@ var layers = new ol.Collection([ }), new ol.layer.ImageLayer({ source: new ol.source.SingleImageWMS({ - //resolutions: resolutions, url: 'http://wms.geo.admin.ch/', attributions: [new ol.Attribution( '© ' + diff --git a/src/ol/map.js b/src/ol/map.js index 9dfcee6d75..771122e531 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -941,7 +941,7 @@ ol.Map.createControls_ = function(mapOptions) { mapOptions.zoomControl : true; if (zoomControl) { var zoomDelta = goog.isDef(mapOptions.zoomDelta) ? - mapOptions.zoomDelta : 4; + mapOptions.zoomDelta : 1; controls.push(new ol.control.Zoom({ delta: zoomDelta })); @@ -971,7 +971,7 @@ ol.Map.createInteractions_ = function(mapOptions) { mapOptions.doubleClickZoom : true; if (doubleClickZoom) { var zoomDelta = goog.isDef(mapOptions.zoomDelta) ? - mapOptions.zoomDelta : 4; + mapOptions.zoomDelta : 1; interactions.push(new ol.interaction.DblClickZoom(zoomDelta)); } diff --git a/src/ol/view2d.js b/src/ol/view2d.js index f80d3cf25c..9f8a82db1c 100644 --- a/src/ol/view2d.js +++ b/src/ol/view2d.js @@ -359,10 +359,8 @@ ol.View2D.createConstraints_ = function(view2DOptions) { maxResolution = Math.max( projectionExtent.maxX - projectionExtent.minX, projectionExtent.maxY - projectionExtent.minY) / ol.DEFAULT_TILE_SIZE; - // number of steps we want between two data resolutions - var numSteps = 4; - numZoomLevels = 29 * numSteps; - zoomFactor = Math.exp(Math.log(2) / numSteps); + numZoomLevels = 29; + zoomFactor = 2; } resolutionConstraint = ol.ResolutionConstraint.createSnapToPower( zoomFactor, maxResolution, numZoomLevels - 1); diff --git a/test/spec/ol/map.test.js b/test/spec/ol/map.test.js index 776d268400..c5e0ff2b30 100644 --- a/test/spec/ol/map.test.js +++ b/test/spec/ol/map.test.js @@ -121,7 +121,7 @@ describe('ol.Map', function() { var interactions = ol.Map.createInteractions_(options); expect(interactions.getLength()).toEqual(1); expect(interactions.getAt(0)).toBeA(ol.interaction.DblClickZoom); - expect(interactions.getAt(0).delta_).toEqual(4); + expect(interactions.getAt(0).delta_).toEqual(1); }); });