incorporate @ahocevar's review
This commit is contained in:
@@ -414,17 +414,14 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
* changebaselayer event will be triggered.
|
||||
*/
|
||||
addOptions: function (newOptions, reinitialize) {
|
||||
var singleTileChanged = newOptions.singleTile !== undefined &&
|
||||
newOptions.singleTile !== this.singleTile;
|
||||
OpenLayers.Layer.HTTPRequest.prototype.addOptions.apply(this, arguments);
|
||||
if (this.map && newOptions.singleTile !== undefined) {
|
||||
this.initProperties();
|
||||
this.clearGrid();
|
||||
if (newOptions.singleTile === true) {
|
||||
if (this.map && singleTileChanged) {
|
||||
this.initProperties();
|
||||
this.tileSize = this.options.tileSize;
|
||||
this.setTileSize();
|
||||
this.initSingleTile(this.map.getExtent());
|
||||
} else {
|
||||
this.tileSize = this.options.tileSize || this.map.getTileSize();
|
||||
this.initGriddedTiles(this.map.getExtent());
|
||||
}
|
||||
this.moveTo(null, true);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user