More zoom level bounds checking.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@28 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-13 15:25:28 +00:00
parent 8dc75d0d7c
commit 7b62f33544

View File

@@ -225,7 +225,7 @@ OpenLayers.Map.prototype = {
this.zoom = zoom;
}
this.moveToNewExtent();
this.moveToNewExtent(zoomChanged);
},
moveToNewExtent: function (zoomChanged) {
@@ -244,7 +244,7 @@ OpenLayers.Map.prototype = {
* Increase zoom level by one.
*/
zoomIn: function() {
if (this.zoom != null) {
if (this.zoom != null && this.zoom <= this.getZoomLevels()) {
this.zoom += 1;
this.moveToNewExtent(true);
}
@@ -256,8 +256,10 @@ OpenLayers.Map.prototype = {
* Set Zoom To int
*/
zoomTo: function(zoom) {
if (zoom >= 0 && zoom <= this.getZoomLevels()) {
this.zoom = zoom;
this.moveToNewExtent(true);
}
},
/**