diff --git a/examples/notile.html b/examples/notile.html new file mode 100644 index 0000000000..76b3750316 --- /dev/null +++ b/examples/notile.html @@ -0,0 +1,30 @@ + + + + + + + +

OpenLayers Example

+
+ + diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index bb74672d5f..720c657368 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -65,6 +65,7 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") { // "OpenLayers/Layer/Yahoo.js", "OpenLayers/Layer/Grid.js", "OpenLayers/Layer/KaMap.js", + "OpenLayers/Layer/UntiledWMS.js", "OpenLayers/Layer/Markers.js", "OpenLayers/Layer/Text.js", "OpenLayers/Layer/WMS.js", diff --git a/lib/OpenLayers/Layer/UntiledWMS.js b/lib/OpenLayers/Layer/UntiledWMS.js new file mode 100644 index 0000000000..b6431d5808 --- /dev/null +++ b/lib/OpenLayers/Layer/UntiledWMS.js @@ -0,0 +1,95 @@ +/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. + * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full + * text of the license. */ +// @require: OpenLayers/Layer/Grid.js +/** +* @class +*/ +OpenLayers.Layer.UntiledWMS = Class.create(); +OpenLayers.Layer.UntiledWMS.prototype = + Object.extend( new OpenLayers.Layer.Grid(), { + + /** @final @type hash */ + DEFAULT_PARAMS: { service: "WMS", + version: "1.1.1", + request: "GetMap", + styles: "", + exceptions: "application/vnd.ogc.se_inimage", + format: "image/jpeg" + }, + + /** + * @constructor + * + * @param {str} name + * @param {str} url + * @param {hash} params + */ + initialize: function(name, url, params) { + var newArguments = new Array(); + if (arguments.length > 0) { + //uppercase params + params = OpenLayers.Util.upperCaseObject(params); + newArguments.push(name, url, params); + } + OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments); + + if (arguments.length > 0) { + OpenLayers.Util.applyDefaults( + this.params, + OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS) + ); + } + }, + + + /** WFS layer is never a base class. + * @type Boolean + */ + isBaseLayer: function() { + return (this.params.TRANSPARENT != true); + }, + + /** + * @param {String} name + * @param {hash} params + * + * @returns A clone of this OpenLayers.Layer.WMS, with the passed-in + * parameters merged in. + * @type OpenLayers.Layer.WMS + */ + clone: function (name, params) { + var mergedParams = {}; + Object.extend(mergedParams, this.params); + Object.extend(mergedParams, params); + var obj = new OpenLayers.Layer.WMS(name, this.url, mergedParams); + obj.setTileSize(this.tileSize); + return obj; + }, + + /** + * addTile creates a tile, initializes it (via 'draw' in this case), and + * adds it to the layer div. + * + * @param {OpenLayers.Bounds} bounds + * + * @returns The added OpenLayers.Tile.Image + * @type OpenLayers.Tile.Image + */ + addTile:function(bounds,position) { + url = this.getFullRequestString( + {BBOX:bounds.toBBOX(), + WIDTH:this.map.getSize().w, + HEIGHT:this.map.getSize().h}); + + return new OpenLayers.Tile.Image(this, position, bounds, + url, this.map.getSize()); + }, + moveTo:function(bounds,zoomChanged) { + this.div.innerHTML = ""; + tile = this.addTile(bounds, new OpenLayers.Pixel(-parseInt(this.map.layerContainerDiv.style.left), -parseInt(this.map.layerContainerDiv.style.top))); + tile.draw(); + }, + /** @final @type String */ + CLASS_NAME: "OpenLayers.Layer.UntiledWMS" +});