Remove extra WMS subclasses.
This commit is contained in:
@@ -40,9 +40,7 @@
|
||||
</p>
|
||||
<div id="map" class="smallmap"></div>
|
||||
<div id="docs">
|
||||
An untiled layer will only request a single image at a time.
|
||||
This is equivalent to using the deprecated
|
||||
OpenLayers.Layer.WMS.Untiled class, which will be removed at 3.0.
|
||||
An untiled (with singleTile: true) layer will only request a single image at a time.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -144,8 +144,6 @@
|
||||
"OpenLayers/Layer/WorldWind.js",
|
||||
"OpenLayers/Layer/ArcGIS93Rest.js",
|
||||
"OpenLayers/Layer/WMS.js",
|
||||
"OpenLayers/Layer/WMS/Untiled.js",
|
||||
"OpenLayers/Layer/WMS/Post.js",
|
||||
"OpenLayers/Layer/WMTS.js",
|
||||
"OpenLayers/Layer/ArcIMS.js",
|
||||
"OpenLayers/Layer/GeoRSS.js",
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for
|
||||
* full list of contributors). Published under the Clear BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||
* full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Layer/WMS.js
|
||||
* @requires OpenLayers/Tile/Image/IFrame.js
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class: OpenLayers.Layer.WMS.Post
|
||||
* Instances of OpenLayers.Layer.WMS.Post are used to retrieve data from OGC
|
||||
* 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, {
|
||||
|
||||
/**
|
||||
* APIProperty: unsupportedBrowsers
|
||||
* {Array} Array with browsers, which should use the HTTP-GET protocol
|
||||
* instead of HTTP-POST for fetching tiles from a WMS .
|
||||
* Defaults to ["mozilla", "firefox", "opera"], because Opera is not able
|
||||
* to show transparent images in IFrames and Firefox/Mozilla has some ugly
|
||||
* effects of viewport-shaking when panning the map. Both browsers, Opera
|
||||
* and Firefox/Mozilla, have no problem with long urls, which is the reason
|
||||
* for using POST instead of GET. The strings to pass to this array are
|
||||
* the ones returned by <OpenLayers.BROWSER_NAME>.
|
||||
*/
|
||||
unsupportedBrowsers: ["mozilla", "firefox", "opera"],
|
||||
|
||||
/**
|
||||
* Property: SUPPORTED_TRANSITIONS
|
||||
* {Array}
|
||||
* no supported transitions for this type of layer, because it is not
|
||||
* possible to modify the initialized tiles (iframes)
|
||||
*/
|
||||
SUPPORTED_TRANSITIONS: [],
|
||||
|
||||
/**
|
||||
* Property: usePost
|
||||
* {Boolean}
|
||||
*/
|
||||
usePost: null,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.WMS.Post
|
||||
* Creates a new WMS layer object.
|
||||
*
|
||||
* Example:
|
||||
* (code)
|
||||
* var wms = new OpenLayers.Layer.WMS.Post(
|
||||
* "NASA Global Mosaic",
|
||||
* "http://wms.jpl.nasa.gov/wms.cgi",
|
||||
* {layers: "modis, global_mosaic"});
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
* name - {String} A name for the layer
|
||||
* url - {String} Base url for the WMS
|
||||
* (e.g. http://wms.jpl.nasa.gov/wms.cgi)
|
||||
* params - {Object} An object with key/value pairs representing the
|
||||
* GetMap query string parameters and parameter values.
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer.
|
||||
*/
|
||||
initialize: function(name, url, params, options) {
|
||||
var newArguments = [];
|
||||
newArguments.push(name, url, params, options);
|
||||
OpenLayers.Layer.WMS.prototype.initialize.apply(this, newArguments);
|
||||
|
||||
this.usePost = OpenLayers.Util.indexOf(
|
||||
this.unsupportedBrowsers, OpenLayers.BROWSER_NAME) == -1;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: addTile
|
||||
* addTile creates a tile, initializes it and adds it as iframe to the
|
||||
* layer div.
|
||||
*
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>}
|
||||
* position - {<OpenLayers.Pixel>}
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Tile.Image.IFrame>} The added OpenLayers.Tile.Image.IFrame
|
||||
*/
|
||||
addTile: function(bounds,position) {
|
||||
return new OpenLayers.Tile.Image(
|
||||
this, position, bounds, null, this.tileSize, {
|
||||
maxGetUrlLength: this.usePost ? 0 : null
|
||||
});
|
||||
},
|
||||
|
||||
CLASS_NAME: 'OpenLayers.Layer.WMS.Post'
|
||||
});
|
||||
@@ -1,72 +0,0 @@
|
||||
/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for
|
||||
* full list of contributors). Published under the Clear BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||
* full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Layer/WMS.js
|
||||
* @requires OpenLayers/Console.js
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class: OpenLayers.Layer.WMS.Untiled
|
||||
* *Deprecated*. To be removed in 3.0. Instead use OpenLayers.Layer.WMS and
|
||||
* pass the option 'singleTile' as true.
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Layer.WMS>
|
||||
*/
|
||||
OpenLayers.Layer.WMS.Untiled = OpenLayers.Class(OpenLayers.Layer.WMS, {
|
||||
|
||||
/**
|
||||
* APIProperty: singleTile
|
||||
* {singleTile} Always true for untiled.
|
||||
*/
|
||||
singleTile: true,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.WMS.Untiled
|
||||
*
|
||||
* Parameters:
|
||||
* name - {String}
|
||||
* url - {String}
|
||||
* params - {Object}
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(name, url, params, options) {
|
||||
OpenLayers.Layer.WMS.prototype.initialize.apply(this, arguments);
|
||||
|
||||
var msg = "The OpenLayers.Layer.WMS.Untiled class is deprecated and " +
|
||||
"will be removed in 3.0. Instead, you should use the " +
|
||||
"normal OpenLayers.Layer.WMS class, passing it the option " +
|
||||
"'singleTile' as true.";
|
||||
OpenLayers.Console.warn(msg);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: clone
|
||||
* Create a clone of this layer
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Layer.WMS.Untiled>} An exact clone of this layer
|
||||
*/
|
||||
clone: function (obj) {
|
||||
|
||||
if (obj == null) {
|
||||
obj = new OpenLayers.Layer.WMS.Untiled(this.name,
|
||||
this.url,
|
||||
this.params,
|
||||
this.getOptions());
|
||||
}
|
||||
|
||||
//get all additions from superclasses
|
||||
obj = OpenLayers.Layer.WMS.prototype.clone.apply(this, [obj]);
|
||||
|
||||
// copy/set any non-init, non-simple values here
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Layer.WMS.Untiled"
|
||||
});
|
||||
@@ -1740,7 +1740,161 @@ OpenLayers.Util.extend(OpenLayers.Format.XML.prototype, {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: OpenLayers.Layer.WMS.Post
|
||||
* Instances of OpenLayers.Layer.WMS.Post are used to retrieve data from OGC
|
||||
* 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, {
|
||||
|
||||
/**
|
||||
* APIProperty: unsupportedBrowsers
|
||||
* {Array} Array with browsers, which should use the HTTP-GET protocol
|
||||
* instead of HTTP-POST for fetching tiles from a WMS .
|
||||
* Defaults to ["mozilla", "firefox", "opera"], because Opera is not able
|
||||
* to show transparent images in IFrames and Firefox/Mozilla has some ugly
|
||||
* effects of viewport-shaking when panning the map. Both browsers, Opera
|
||||
* and Firefox/Mozilla, have no problem with long urls, which is the reason
|
||||
* for using POST instead of GET. The strings to pass to this array are
|
||||
* the ones returned by <OpenLayers.BROWSER_NAME>.
|
||||
*/
|
||||
unsupportedBrowsers: ["mozilla", "firefox", "opera"],
|
||||
|
||||
/**
|
||||
* Property: SUPPORTED_TRANSITIONS
|
||||
* {Array}
|
||||
* no supported transitions for this type of layer, because it is not
|
||||
* possible to modify the initialized tiles (iframes)
|
||||
*/
|
||||
SUPPORTED_TRANSITIONS: [],
|
||||
|
||||
/**
|
||||
* Property: usePost
|
||||
* {Boolean}
|
||||
*/
|
||||
usePost: null,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.WMS.Post
|
||||
* Creates a new WMS layer object.
|
||||
*
|
||||
* Example:
|
||||
* (code)
|
||||
* var wms = new OpenLayers.Layer.WMS.Post(
|
||||
* "NASA Global Mosaic",
|
||||
* "http://wms.jpl.nasa.gov/wms.cgi",
|
||||
* {layers: "modis, global_mosaic"});
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
* name - {String} A name for the layer
|
||||
* url - {String} Base url for the WMS
|
||||
* (e.g. http://wms.jpl.nasa.gov/wms.cgi)
|
||||
* params - {Object} An object with key/value pairs representing the
|
||||
* GetMap query string parameters and parameter values.
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer.
|
||||
*/
|
||||
initialize: function(name, url, params, options) {
|
||||
var newArguments = [];
|
||||
newArguments.push(name, url, params, options);
|
||||
OpenLayers.Layer.WMS.prototype.initialize.apply(this, newArguments);
|
||||
|
||||
this.usePost = OpenLayers.Util.indexOf(
|
||||
this.unsupportedBrowsers, OpenLayers.BROWSER_NAME) == -1;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: addTile
|
||||
* addTile creates a tile, initializes it and adds it as iframe to the
|
||||
* layer div.
|
||||
*
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>}
|
||||
* position - {<OpenLayers.Pixel>}
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Tile.Image.IFrame>} The added OpenLayers.Tile.Image.IFrame
|
||||
*/
|
||||
addTile: function(bounds,position) {
|
||||
return new OpenLayers.Tile.Image(
|
||||
this, position, bounds, null, this.tileSize, {
|
||||
maxGetUrlLength: this.usePost ? 0 : null
|
||||
});
|
||||
},
|
||||
|
||||
CLASS_NAME: 'OpenLayers.Layer.WMS.Post'
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: OpenLayers.Layer.WMS.Untiled
|
||||
* *Deprecated*. To be removed in 3.0. Instead use OpenLayers.Layer.WMS and
|
||||
* pass the option 'singleTile' as true.
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Layer.WMS>
|
||||
*/
|
||||
OpenLayers.Layer.WMS.Untiled = OpenLayers.Class(OpenLayers.Layer.WMS, {
|
||||
|
||||
/**
|
||||
* APIProperty: singleTile
|
||||
* {singleTile} Always true for untiled.
|
||||
*/
|
||||
singleTile: true,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.WMS.Untiled
|
||||
*
|
||||
* Parameters:
|
||||
* name - {String}
|
||||
* url - {String}
|
||||
* params - {Object}
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(name, url, params, options) {
|
||||
OpenLayers.Layer.WMS.prototype.initialize.apply(this, arguments);
|
||||
|
||||
var msg = "The OpenLayers.Layer.WMS.Untiled class is deprecated and " +
|
||||
"will be removed in 3.0. Instead, you should use the " +
|
||||
"normal OpenLayers.Layer.WMS class, passing it the option " +
|
||||
"'singleTile' as true.";
|
||||
OpenLayers.Console.warn(msg);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: clone
|
||||
* Create a clone of this layer
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Layer.WMS.Untiled>} An exact clone of this layer
|
||||
*/
|
||||
clone: function (obj) {
|
||||
|
||||
if (obj == null) {
|
||||
obj = new OpenLayers.Layer.WMS.Untiled(this.name,
|
||||
this.url,
|
||||
this.params,
|
||||
this.getOptions());
|
||||
}
|
||||
|
||||
//get all additions from superclasses
|
||||
obj = OpenLayers.Layer.WMS.prototype.clone.apply(this, [obj]);
|
||||
|
||||
// copy/set any non-init, non-simple values here
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Layer.WMS.Untiled"
|
||||
});
|
||||
|
||||
|
||||
@@ -196,9 +196,9 @@
|
||||
{ controls: [] , 'numZoomLevels':20});
|
||||
|
||||
var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP, 'maxZoomLevel':18} );
|
||||
var layer = new OpenLayers.Layer.WMS.Untiled( "OpenLayers WMS",
|
||||
var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic', 'transparent':true},
|
||||
{isBaseLayer: false} );
|
||||
{isBaseLayer: false, singleTile: true} );
|
||||
|
||||
map.addLayers([satellite, layer]);
|
||||
map.setCenter(new OpenLayers.LonLat(10.205188,48.857593), 5);
|
||||
|
||||
@@ -146,9 +146,9 @@
|
||||
{ controls: [] , 'numZoomLevels':20});
|
||||
|
||||
var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: google.maps.MapTypeId.SATELLITE, 'maxZoomLevel':18} );
|
||||
var layer = new OpenLayers.Layer.WMS.Untiled( "OpenLayers WMS",
|
||||
var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic', 'transparent':true},
|
||||
{isBaseLayer: false} );
|
||||
{isBaseLayer: false, singleTile: true} );
|
||||
|
||||
map.addLayers([satellite, layer]);
|
||||
map.setCenter(new OpenLayers.LonLat(10.205188,48.857593), 5);
|
||||
|
||||
@@ -445,19 +445,6 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// DEPRECATED -- REMOVE IN 3.0
|
||||
function test_Layer_Untiled_WMS(t) {
|
||||
t.plan(1);
|
||||
|
||||
var layer = new OpenLayers.Layer.WMS.Untiled();
|
||||
|
||||
var clone = layer.clone();
|
||||
|
||||
t.ok(clone.singleTile, "regression test: clone works. this is for #1013");
|
||||
}
|
||||
|
||||
function test_Layer_WMS_destroy (t) {
|
||||
|
||||
t.plan( 1 );
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="../../OLLoader.js"></script>
|
||||
<script src="../../../OLLoader.js"></script>
|
||||
<script src="../../../../lib/deprecated.js"></script>
|
||||
<script type="text/javascript">
|
||||
var isMozilla = (navigator.userAgent.indexOf("compatible") == -1);
|
||||
var isOpera = (navigator.userAgent.indexOf("Opera") != -1);
|
||||
@@ -169,7 +169,6 @@
|
||||
<li>Layer/Vector/RootContainer.html</li>
|
||||
<li>Layer/WFS.html</li>
|
||||
<li>Layer/WMS.html</li>
|
||||
<li>Layer/WMS/Post.html</li>
|
||||
<li>Layer/WMTS.html</li>
|
||||
<li>Layer/WrapDateLine.html</li>
|
||||
<li>Layer/XYZ.html</li>
|
||||
@@ -231,4 +230,5 @@
|
||||
<li>deprecated/BaseTypes/Class.html</li>
|
||||
<li>deprecated/BaseTypes/Element.html</li>
|
||||
<li>deprecated/Control/MouseToolbar.html</li>
|
||||
<li>deprecated/Layer/WMS/Post.html</li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user