New OpenLayers.Layer.Grid.tileClass option. Defaults to OpenLayers.Tile.Image

This commit is contained in:
fredj
2012-01-04 12:05:34 +01:00
parent 2fabd6954c
commit 3245836b6d
2 changed files with 31 additions and 4 deletions

View File

@@ -50,6 +50,13 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* created by this Layer, if supported by the tile class.
*/
tileOptions: null,
/**
* APIProperty: tileClass
* {<OpenLayers.Tile>} The tile class to use for this layer.
* Defaults is OpenLayers.Tile.Image.
*/
tileClass: OpenLayers.Tile.Image,
/**
* Property: grid
@@ -900,9 +907,9 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* Returns:
* {<OpenLayers.Tile>} The added OpenLayers.Tile
*/
addTile:function(bounds, position) {
return new OpenLayers.Tile.Image(this, position, bounds, null,
this.tileSize, this.tileOptions);
addTile: function(bounds, position) {
return new this.tileClass(this, position, bounds, null,
this.tileSize, this.tileOptions);
},
/**