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.
|
* changebaselayer event will be triggered.
|
||||||
*/
|
*/
|
||||||
addOptions: function (newOptions, reinitialize) {
|
addOptions: function (newOptions, reinitialize) {
|
||||||
|
var singleTileChanged = newOptions.singleTile !== undefined &&
|
||||||
|
newOptions.singleTile !== this.singleTile;
|
||||||
OpenLayers.Layer.HTTPRequest.prototype.addOptions.apply(this, arguments);
|
OpenLayers.Layer.HTTPRequest.prototype.addOptions.apply(this, arguments);
|
||||||
if (this.map && newOptions.singleTile !== undefined) {
|
if (this.map && singleTileChanged) {
|
||||||
this.initProperties();
|
this.initProperties();
|
||||||
this.clearGrid();
|
this.tileSize = this.options.tileSize;
|
||||||
if (newOptions.singleTile === true) {
|
|
||||||
this.setTileSize();
|
this.setTileSize();
|
||||||
this.initSingleTile(this.map.getExtent());
|
this.moveTo(null, true);
|
||||||
} else {
|
|
||||||
this.tileSize = this.options.tileSize || this.map.getTileSize();
|
|
||||||
this.initGriddedTiles(this.map.getExtent());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user