Merge all changes from the naturaldocs sandbox. This brings all the work that
has been done in the NaturalDocs branch back to trunk. Thanks to everyone who helped out in making this happen. (I could list people, but the list would be long, and I'm already mentally on vacation.) git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -2,44 +2,60 @@
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
/* Derived from the WMS/Untiled.js script by Stephen Woodbridge, 2007 */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Layer/HTTPRequest.js
|
||||
* @requires OpenLayers/Layer/MapServer.js
|
||||
*
|
||||
* Class: OpenLayers.Layer.MapServer.Untiled
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Layer.HTTPRequest>
|
||||
*/
|
||||
OpenLayers.Layer.MapServer.Untiled = OpenLayers.Class.create();
|
||||
OpenLayers.Layer.MapServer.Untiled.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Layer.HTTPRequest, {
|
||||
|
||||
/** Hashtable of default parameter key/value pairs
|
||||
* @final @type Object */
|
||||
/**
|
||||
* Constant: default_params
|
||||
* Hashtable of default parameter key/value pairs
|
||||
*/
|
||||
default_params: {
|
||||
mode: "map",
|
||||
map_imagetype: "png"
|
||||
},
|
||||
|
||||
/**
|
||||
* APIProperty: reproject
|
||||
* {Boolean} 'stretch' tiles according to base layer.
|
||||
*/
|
||||
reproject: true,
|
||||
|
||||
/** the ratio of image/tile size to map size (this is the untiled buffer)
|
||||
* @type int */
|
||||
/**
|
||||
* APIProperty: ratio
|
||||
* {Float} the ratio of image/tile size to map size (this is the untiled
|
||||
* buffer)
|
||||
*/
|
||||
ratio: 1,
|
||||
|
||||
/** @type OpenLayers.Tile.Image */
|
||||
/**
|
||||
* Property: tile
|
||||
* {<OpenLayers.Tile.Image>}
|
||||
*/
|
||||
tile: null,
|
||||
|
||||
/** did the image finish loading before a new draw was initiated?
|
||||
* @type Boolean */
|
||||
/**
|
||||
* Propety: doneLoading
|
||||
* {Boolean} did the image finish loading before a new draw was initiated?
|
||||
*/
|
||||
doneLoading: false,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor: OpenLayers.Layer.MapServer.Untiled
|
||||
*
|
||||
* @param {String} name
|
||||
* @param {String} url
|
||||
* @param {Object} params
|
||||
* Parameters:
|
||||
* name - {String}
|
||||
* url - {String}
|
||||
* params - {Object}
|
||||
*/
|
||||
initialize: function(name, url, params, options) {
|
||||
var newArguments = [];
|
||||
@@ -60,7 +76,7 @@ OpenLayers.Layer.MapServer.Untiled.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
if (this.tile) {
|
||||
@@ -71,10 +87,12 @@ OpenLayers.Layer.MapServer.Untiled.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Object} obj
|
||||
* APIMethod: clone
|
||||
* obj - {Object}
|
||||
*
|
||||
* @returns An exact clone of this OpenLayers.Layer.MapServer.Untiled
|
||||
* @type OpenLayers.Layer.MapServer.Untiled
|
||||
* Returns:
|
||||
* {<OpenLayers.Layer.MapServer.Untiled>} An exact clone of this
|
||||
* OpenLayers.Layer.MapServer.Untiled
|
||||
*/
|
||||
clone: function (obj) {
|
||||
|
||||
@@ -94,15 +112,19 @@ OpenLayers.Layer.MapServer.Untiled.prototype =
|
||||
},
|
||||
|
||||
|
||||
/** Once HTTPRequest has set the map, we can load the image div
|
||||
/**
|
||||
* Method: setMap
|
||||
* Once HTTPRequest has set the map, we can load the image div
|
||||
*
|
||||
* @param {OpenLayers.Map} map
|
||||
* Parameters:
|
||||
* map - {<OpenLayers.Map>}
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Layer.HTTPRequest.prototype.setMap.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: setTileSize
|
||||
* Set the tile size based on the map size. This also sets layer.imageSize
|
||||
* and layer.imageOffset for use by Tile.Image.
|
||||
*/
|
||||
@@ -115,12 +137,15 @@ OpenLayers.Layer.MapServer.Untiled.prototype =
|
||||
this.imageOffset = new OpenLayers.Pixel(0, 0);
|
||||
},
|
||||
|
||||
/** When it is not a dragging move (ie when done dragging)
|
||||
/**
|
||||
* Method: moveTo
|
||||
* When it is not a dragging move (ie when done dragging)
|
||||
* reload and recenter the div.
|
||||
*
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} zoomChanged
|
||||
* @param {Boolean} dragging
|
||||
*
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>}
|
||||
* zoomChanged - {Boolean}
|
||||
* dragging - {Boolean}
|
||||
*/
|
||||
moveTo:function(bounds, zoomChanged, dragging) {
|
||||
if (!this.doneLoading) {
|
||||
@@ -190,7 +215,13 @@ OpenLayers.Layer.MapServer.Untiled.prototype =
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: getURL
|
||||
*
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>}
|
||||
*/
|
||||
getURL: function(bounds) {
|
||||
var url = this.getFullRequestString(
|
||||
{mapext:bounds.toBBOX().replace(/,/g," "),
|
||||
@@ -204,16 +235,24 @@ OpenLayers.Layer.MapServer.Untiled.prototype =
|
||||
},
|
||||
|
||||
|
||||
/** Once HTTPRequest has updated the url, reload the image div
|
||||
* @param {String} newUrl
|
||||
/**
|
||||
* APIMehod: setUrl
|
||||
* Once HTTPRequest has updated the url, reload the image div
|
||||
*
|
||||
* Parameters:
|
||||
* newUrl - {String}
|
||||
*/
|
||||
setUrl: function(newUrl) {
|
||||
OpenLayers.Layer.HTTPRequest.prototype.setUrl.apply(this, arguments);
|
||||
this.moveTo();
|
||||
},
|
||||
|
||||
/** Once HTTPRequest has updated new params, reload the image div
|
||||
* @param {Object} newParams
|
||||
/**
|
||||
* APIMethod: mergeNewParams
|
||||
* Once HTTPRequest has updated new params, reload the image div
|
||||
*
|
||||
* Parameters:
|
||||
* newParams - {Object}
|
||||
*/
|
||||
mergeNewParams:function(newParams) {
|
||||
OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,
|
||||
@@ -222,15 +261,16 @@ OpenLayers.Layer.MapServer.Untiled.prototype =
|
||||
this.moveTo(null, true);
|
||||
},
|
||||
|
||||
/** combine the layer's url with its params and these newParams.
|
||||
/**
|
||||
* APIMethod: getFullRequestString
|
||||
* combine the layer's url with its params and these newParams.
|
||||
*
|
||||
* Add the SRS parameter from 'projection' -- this is probably
|
||||
* more eloquently done via a setProjection() method, but this
|
||||
* works for now and always.
|
||||
*
|
||||
* @param {Object} newParams
|
||||
*
|
||||
* @type String
|
||||
*
|
||||
* Parameters:
|
||||
* newParams - {Object}
|
||||
*/
|
||||
getFullRequestString:function(newParams) {
|
||||
var projection = this.map.getProjection();
|
||||
|
||||
Reference in New Issue
Block a user