Merge pull request #266 from tschaub/permalink

Making map construction work with permalink.
This commit is contained in:
Tim Schaub
2012-03-01 15:11:10 -08:00
2 changed files with 27 additions and 1 deletions
+4 -1
View File
@@ -496,13 +496,16 @@ OpenLayers.Map = OpenLayers.Class({
this.projection.projCode : this.projection;
OpenLayers.Util.applyDefaults(this, OpenLayers.Projection.defaults[projCode]);
// allow extents to be arrays
// allow extents and center 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);
}
if (this.center && !(this.center instanceof OpenLayers.LonLat)) {
this.center = new OpenLayers.LonLat(this.center);
}
// initialize layers array
this.layers = [];