Revised directory structure (js/ -> lib/, test/ -> tests/) to match JSAN distribution standards, as documented at http://www.openjsan.org/documentation/dists.html.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
46
lib/OpenLayers/Layer/WMS.js
Normal file
46
lib/OpenLayers/Layer/WMS.js
Normal file
@@ -0,0 +1,46 @@
|
||||
OpenLayers.Layer.WMS = Class.create();
|
||||
OpenLayers.Layer.WMS.prototype =
|
||||
Object.extend( new OpenLayers.Layer.Grid(), {
|
||||
|
||||
// hash
|
||||
DEFAULT_PARAMS: {
|
||||
service: "WMS",
|
||||
version: "1.1.1",
|
||||
request: "GetMap",
|
||||
srs: "EPSG:4326",
|
||||
exceptions: "application/vnd.ogc.se_inimage"
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {str} name
|
||||
* @param {str} url
|
||||
* @param {hash} params
|
||||
*/
|
||||
initialize: function(name, url, params) {
|
||||
OpenLayers.Layer.Grid.prototype.initialize.apply(this, arguments);
|
||||
Object.extend(this.params, this.DEFAULT_PARAMS);
|
||||
},
|
||||
|
||||
/**
|
||||
* addTile creates a tile, initializes it (via 'draw' in this case), and
|
||||
* adds it to the layer div. THe tile itself is then returned so that info
|
||||
* about it can be stored for later reuse.
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*/
|
||||
addTile:function(bounds,position) {
|
||||
url = this.getFullRequestString(
|
||||
{bbox:bounds.toBBOX(),
|
||||
width:this.tileSize.w,
|
||||
height:this.tileSize.h});
|
||||
var tile = new OpenLayers.Tile.Image(bounds, url, this.tileSize);
|
||||
tile.draw();
|
||||
tile.setPosition(position);
|
||||
this.div.appendChild(tile.img);
|
||||
return tile;
|
||||
},
|
||||
|
||||
_initTiles: function () {
|
||||
this.div.innerHTML="";
|
||||
OpenLayers.Layer.Grid.prototype._initTiles.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user