move addTile code to the base class (OpenLayers.Layer.Grid). r=crschmidt (closes #2904)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11575 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2011-02-28 08:12:05 +00:00
parent f7d58dc36c
commit 1887969a3c
13 changed files with 3 additions and 197 deletions

View File

@@ -232,22 +232,5 @@ OpenLayers.Layer.ArcGIS93Rest = OpenLayers.Class(OpenLayers.Layer.Grid, {
newArguments); newArguments);
}, },
/**
* Method: addTile
* addTile creates a tile, initializes it, and adds it to the layer div.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added OpenLayers.Tile.Image
*/
addTile:function(bounds,position) {
return new OpenLayers.Tile.Image(this, position, bounds,
null, this.tileSize);
},
CLASS_NAME: "OpenLayers.Layer.ArcGIS93Rest" CLASS_NAME: "OpenLayers.Layer.ArcGIS93Rest"
}); });

View File

@@ -445,22 +445,5 @@ OpenLayers.Layer.ArcIMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
return obj; return obj;
}, },
/**
* Method: addTile
* addTile creates a tile, initializes it, and adds it to the layer div.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added image tile.
*/
addTile:function(bounds,position) {
return new OpenLayers.Tile.Image(
this, position, bounds, null, this.tileSize
);
},
CLASS_NAME: "OpenLayers.Layer.ArcIMS" CLASS_NAME: "OpenLayers.Layer.ArcIMS"
}); });

View File

@@ -629,9 +629,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
/** /**
* APIMethod: addTile * APIMethod: addTile
* Gives subclasses of Grid the opportunity to create an * Create a tile, initialize it, and add it to the layer div.
* OpenLayer.Tile of their choosing. The implementer should initialize
* the new tile and take whatever steps necessary to display it.
* *
* Parameters * Parameters
* bounds - {<OpenLayers.Bounds>} * bounds - {<OpenLayers.Bounds>}
@@ -641,7 +639,8 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* {<OpenLayers.Tile>} The added OpenLayers.Tile * {<OpenLayers.Tile>} The added OpenLayers.Tile
*/ */
addTile:function(bounds, position) { addTile:function(bounds, position) {
// Should be implemented by subclasses return new OpenLayers.Tile.Image(this, position, bounds, null,
this.tileSize, this.tileOptions);
}, },
/** /**

View File

@@ -94,22 +94,6 @@ OpenLayers.Layer.KaMap = OpenLayers.Class(OpenLayers.Layer.Grid, {
}); });
}, },
/**
* Method: addTile
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>}
*/
addTile:function(bounds,position) {
var url = this.getURL(bounds);
return new OpenLayers.Tile.Image(this, position, bounds,
url, this.tileSize);
},
/** /**
* Method: calculateGridLayout * Method: calculateGridLayout
* ka-Map uses the center point of the map as an origin for * ka-Map uses the center point of the map as an origin for

View File

@@ -233,22 +233,6 @@ OpenLayers.Layer.MapGuide = OpenLayers.Class(OpenLayers.Layer.Grid, {
return obj; return obj;
}, },
/**
* Method: addTile
* Creates a tile, initializes it, and adds it to the layer div.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added OpenLayers.Tile.Image
*/
addTile:function(bounds,position) {
return new OpenLayers.Tile.Image(this, position, bounds,
null, this.tileSize);
},
/** /**
* Method: getURL * Method: getURL
* Return a query string for this layer * Return a query string for this layer

View File

@@ -76,22 +76,6 @@ OpenLayers.Layer.MapServer = OpenLayers.Class(OpenLayers.Layer.Grid, {
return obj; return obj;
}, },
/**
* Method: addTile
* Creates a tile, initializes it, and adds it to the layer div.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added OpenLayers.Tile.Image
*/
addTile:function(bounds,position) {
return new OpenLayers.Tile.Image(this, position, bounds,
null, this.tileSize);
},
/** /**
* Method: getURL * Method: getURL

View File

@@ -131,22 +131,6 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
return url + path; return url + path;
}, },
/**
* Method: addTile
* addTile creates a tile, initializes it, and adds it to the layer div.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added OpenLayers.Tile.Image
*/
addTile:function(bounds,position) {
return new OpenLayers.Tile.Image(this, position, bounds,
null, this.tileSize);
},
/** /**
* APIMethod: setMap * APIMethod: setMap
* When the layer is added to a map, then we can fetch our origin * When the layer is added to a map, then we can fetch our origin

View File

@@ -144,23 +144,6 @@ OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, {
url = (url.charAt(url.length - 1) == '/') ? url : url + '/'; url = (url.charAt(url.length - 1) == '/') ? url : url + '/';
return url + path; return url + path;
}, },
/**
* Method: addTile
* Create a tile, initialize it, and add it to the layer div.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added <OpenLayers.Tile.Image>
*/
addTile:function(bounds, position) {
var url = this.getURL(bounds);
return new OpenLayers.Tile.Image(this, position, bounds,
url, this.tileSize);
},
CLASS_NAME: "OpenLayers.Layer.TileCache" CLASS_NAME: "OpenLayers.Layer.TileCache"
}); });

View File

@@ -202,22 +202,6 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
return requestString; return requestString;
}, },
/**
* Method: addTile
* addTile creates a tile, initializes it, and adds it to the layer div.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added OpenLayers.Tile.Image
*/
addTile:function(bounds,position) {
return new OpenLayers.Tile.Image(this, position, bounds,
null, this.tileSize, this.tileOptions);
},
/** /**
* APIMethod: mergeNewParams * APIMethod: mergeNewParams
* Catch changeParams and uppercase the new params to be merged in * Catch changeParams and uppercase the new params to be merged in

View File

@@ -456,21 +456,5 @@ OpenLayers.Layer.WMTS = OpenLayers.Class(OpenLayers.Layer.Grid, {
} }
}, },
/**
* Method: addTile
* Create a tile, initialize it, and add it to the layer div.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added OpenLayers.Tile.Image
*/
addTile: function(bounds,position) {
return new OpenLayers.Tile.Image(this, position, bounds,
null, this.tileSize);
},
CLASS_NAME: "OpenLayers.Layer.WMTS" CLASS_NAME: "OpenLayers.Layer.WMTS"
}); });

View File

@@ -59,20 +59,6 @@ OpenLayers.Layer.WorldWind = OpenLayers.Class(OpenLayers.Layer.Grid, {
this.params, this.DEFAULT_PARAMS this.params, this.DEFAULT_PARAMS
); );
}, },
/**
* Method: addTile
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added OpenLayers.Tile.Image
*/
addTile:function(bounds,position) {
return new OpenLayers.Tile.Image(this, position, bounds,
null, this.tileSize);
},
/** /**
* Method: getZoom * Method: getZoom

View File

@@ -151,22 +151,6 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
return {'x': x, 'y': y, 'z': z}; return {'x': x, 'y': y, 'z': z};
}, },
/**
* Method: addTile
* addTile creates a tile, initializes it, and adds it to the layer div.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added OpenLayers.Tile.Image
*/
addTile:function(bounds,position) {
return new OpenLayers.Tile.Image(this, position, bounds,
null, this.tileSize);
},
/* APIMethod: setMap /* APIMethod: setMap
* When the layer is added to a map, then we can fetch our origin * When the layer is added to a map, then we can fetch our origin
* (if we don't have one.) * (if we don't have one.)

View File

@@ -238,22 +238,6 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, {
} }
}, },
/**
* Method: addTile
* addTile creates a tile, initializes it, and adds it to the layer div.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* position - {<OpenLayers.Pixel>}
*
* Returns:
* {<OpenLayers.Tile.Image>} The added OpenLayers.Tile.Image
*/
addTile:function(bounds,position) {
return new OpenLayers.Tile.Image(this, position, bounds,
null, this.tileSize);
},
/** /**
* APIMethod: setMap * APIMethod: setMap
* When the layer is added to a map, then we can fetch our origin * When the layer is added to a map, then we can fetch our origin