ability to switch between singleTile true and false

This commit is contained in:
Bart van den Eijnden
2013-01-04 14:29:07 +01:00
parent 193e2696ad
commit 5114ecbaee

View File

@@ -393,6 +393,30 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
this.gridLayout = null;
}
},
/**
* APIMethod: addOptions
*
* Parameters:
* newOptions - {Object}
* reinitialize - {Boolean} If set to true, and if resolution options of the
* current baseLayer were changed, the map will be recentered to make
* sure that it is displayed with a valid resolution, and a
* changebaselayer event will be triggered.
*/
addOptions: function (newOptions, reinitialize) {
OpenLayers.Layer.HTTPRequest.prototype.addOptions.apply(this, arguments);
if (newOptions.singleTile !== undefined) {
this.clearGrid();
if (newOptions.singleTile === true) {
this.setTileSize();
this.initSingleTile(this.map.getExtent());
} else {
this.tileSize = this.options.tileSize || this.map.getTileSize();
this.initGriddedTiles(this.map.getExtent());
}
}
},
/**
* APIMethod: clone