Made Tile.Image.IFrame an addin which will be used only if a layer is configured with the maxGetUrlLength option. This deprecates Layer.WMS.Post. r=tschaub (closes #2824)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10755 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -15,17 +15,15 @@
|
||||
* Web Mapping Services via HTTP-POST (application/x-www-form-urlencoded).
|
||||
* Create a new WMS layer with the <OpenLayers.Layer.WMS.Post> constructor.
|
||||
*
|
||||
* *Deprecated*. Instead of this layer, use <OpenLayers.Layer.WMS> with
|
||||
* <OpenLayers.Tile.Image.maxGetUrlLength> configured in the layer's
|
||||
* <OpenLayers.Layer.WMS.tileOptions>.
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Layer.WMS>
|
||||
*/
|
||||
OpenLayers.Layer.WMS.Post = OpenLayers.Class(OpenLayers.Layer.WMS, {
|
||||
|
||||
/**
|
||||
* Property: tileClass
|
||||
* {Object} Class, used to create tiles.
|
||||
*/
|
||||
tileClass: null,
|
||||
|
||||
/**
|
||||
* APIProperty: unsupportedBrowsers
|
||||
* {Array} Array with browsers, which should use the HTTP-GET protocol
|
||||
@@ -46,6 +44,12 @@ OpenLayers.Layer.WMS.Post = OpenLayers.Class(OpenLayers.Layer.WMS, {
|
||||
* possible to modify the initialized tiles (iframes)
|
||||
*/
|
||||
SUPPORTED_TRANSITIONS: [],
|
||||
|
||||
/**
|
||||
* Property: usePost
|
||||
* {Boolean}
|
||||
*/
|
||||
usePost: null,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.WMS.Post
|
||||
@@ -72,10 +76,8 @@ OpenLayers.Layer.WMS.Post = OpenLayers.Class(OpenLayers.Layer.WMS, {
|
||||
newArguments.push(name, url, params, options);
|
||||
OpenLayers.Layer.WMS.prototype.initialize.apply(this, newArguments);
|
||||
|
||||
this.tileClass = OpenLayers.Util.indexOf(
|
||||
this.unsupportedBrowsers, OpenLayers.Util.getBrowserName()) != -1
|
||||
? OpenLayers.Tile.Image
|
||||
: OpenLayers.Tile.Image.IFrame;
|
||||
this.usePost = OpenLayers.Util.indexOf(
|
||||
this.unsupportedBrowsers, OpenLayers.Util.getBrowserName()) == -1;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -91,8 +93,10 @@ OpenLayers.Layer.WMS.Post = OpenLayers.Class(OpenLayers.Layer.WMS, {
|
||||
* {<OpenLayers.Tile.Image.IFrame>} The added OpenLayers.Tile.Image.IFrame
|
||||
*/
|
||||
addTile: function(bounds,position) {
|
||||
return new this.tileClass(
|
||||
this, position, bounds, null, this.tileSize);
|
||||
return new OpenLayers.Tile.Image(
|
||||
this, position, bounds, null, this.tileSize, {
|
||||
maxGetUrlLength: this.usePost ? 0 : null
|
||||
});
|
||||
},
|
||||
|
||||
CLASS_NAME: 'OpenLayers.Layer.WMS.Post'
|
||||
|
||||
Reference in New Issue
Block a user