protect for null bounds (not-loaded map)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@993 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -170,8 +170,11 @@ OpenLayers.Layer.prototype = {
|
|||||||
setVisibility: function(visible) {
|
setVisibility: function(visible) {
|
||||||
this.div.style.display = (visible) ? "block" : "none";
|
this.div.style.display = (visible) ? "block" : "none";
|
||||||
if ((visible) && (this.map != null)) {
|
if ((visible) && (this.map != null)) {
|
||||||
|
var extent = this.map.getExtent();
|
||||||
|
if (extent != null) {
|
||||||
this.moveTo(this.map.getExtent());
|
this.moveTo(this.map.getExtent());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,10 @@ OpenLayers.Layer.Grid.prototype =
|
|||||||
* @param {Boolean} minor
|
* @param {Boolean} minor
|
||||||
*/
|
*/
|
||||||
moveTo:function(bounds, zoomChanged, minor) {
|
moveTo:function(bounds, zoomChanged, minor) {
|
||||||
|
if (bounds == null) {
|
||||||
|
bounds = this.map.getBounds();
|
||||||
|
}
|
||||||
|
if (bounds != null) {
|
||||||
if (!this.getVisibility()) {
|
if (!this.getVisibility()) {
|
||||||
if (zoomChanged) {
|
if (zoomChanged) {
|
||||||
//now clear out the old grid and start a new one
|
//now clear out the old grid and start a new one
|
||||||
@@ -160,6 +164,7 @@ OpenLayers.Layer.Grid.prototype =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user