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,7 +170,10 @@ 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)) {
|
||||||
this.moveTo(this.map.getExtent());
|
var extent = this.map.getExtent();
|
||||||
|
if (extent != null) {
|
||||||
|
this.moveTo(this.map.getExtent());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -135,28 +135,33 @@ OpenLayers.Layer.Grid.prototype =
|
|||||||
* @param {Boolean} minor
|
* @param {Boolean} minor
|
||||||
*/
|
*/
|
||||||
moveTo:function(bounds, zoomChanged, minor) {
|
moveTo:function(bounds, zoomChanged, minor) {
|
||||||
if (!this.getVisibility()) {
|
if (bounds == null) {
|
||||||
if (zoomChanged) {
|
bounds = this.map.getBounds();
|
||||||
//now clear out the old grid and start a new one
|
}
|
||||||
this.clearGrid();
|
if (bounds != null) {
|
||||||
this.grid = null;
|
if (!this.getVisibility()) {
|
||||||
}
|
if (zoomChanged) {
|
||||||
} else {
|
//now clear out the old grid and start a new one
|
||||||
if (!this.grid || zoomChanged) {
|
this.clearGrid();
|
||||||
this._initTiles();
|
this.grid = null;
|
||||||
} else {
|
|
||||||
var i = 0;
|
|
||||||
while (this.getGridBounds().bottom > bounds.bottom) {
|
|
||||||
this.insertRow(false);
|
|
||||||
}
|
}
|
||||||
while (this.getGridBounds().left > bounds.left) {
|
} else {
|
||||||
this.insertColumn(true);
|
if (!this.grid || zoomChanged) {
|
||||||
}
|
this._initTiles();
|
||||||
while (this.getGridBounds().top < bounds.top) {
|
} else {
|
||||||
this.insertRow(true);
|
var i = 0;
|
||||||
}
|
while (this.getGridBounds().bottom > bounds.bottom) {
|
||||||
while (this.getGridBounds().right < bounds.right) {
|
this.insertRow(false);
|
||||||
this.insertColumn(false);
|
}
|
||||||
|
while (this.getGridBounds().left > bounds.left) {
|
||||||
|
this.insertColumn(true);
|
||||||
|
}
|
||||||
|
while (this.getGridBounds().top < bounds.top) {
|
||||||
|
this.insertRow(true);
|
||||||
|
}
|
||||||
|
while (this.getGridBounds().right < bounds.right) {
|
||||||
|
this.insertColumn(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user