Allow use of array for bounds.
This commit is contained in:
@@ -478,6 +478,14 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
|
||||
// now override default options
|
||||
OpenLayers.Util.extend(this, options);
|
||||
|
||||
// allow extents to be arrays
|
||||
if (this.maxExtent && !(this.maxExtent instanceof OpenLayers.Bounds)) {
|
||||
this.maxExtent = new OpenLayers.Bounds(this.maxExtent);
|
||||
}
|
||||
if (this.restrictedExtent && !(this.restrictedExtent instanceof OpenLayers.Bounds)) {
|
||||
this.restrictedExtent = new OpenLayers.Bounds(this.restrictedExtent);
|
||||
}
|
||||
|
||||
// initialize layers array
|
||||
this.layers = [];
|
||||
@@ -2211,6 +2219,9 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
*
|
||||
*/
|
||||
zoomToExtent: function(bounds, closest) {
|
||||
if (!(bounds instanceof OpenLayers.Bounds)) {
|
||||
bounds = new OpenLayers.Bounds(bounds);
|
||||
}
|
||||
var center = bounds.getCenterLonLat();
|
||||
if (this.baseLayer.wrapDateLine) {
|
||||
var maxExtent = this.getMaxExtent();
|
||||
|
||||
Reference in New Issue
Block a user