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