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:
crschmidt
2007-06-29 15:59:20 +00:00
parent f1c61fd0d6
commit 3948913bfc
107 changed files with 8658 additions and 4011 deletions

View File

@@ -4,55 +4,63 @@
/**
* @class
*
* @requires OpenLayers/Layer/Vector.js
* @requires OpenLayers/Layer/Markers.js
*
* Class: OpenLayers.Layer.WFS
*
* Inherits from:
* - <OpenLayers.Layer.Vector>
* - <OpenLayers.Layer.Markers>
*/
OpenLayers.Layer.WFS = OpenLayers.Class.create();
OpenLayers.Layer.WFS.prototype =
OpenLayers.Class.inherit( OpenLayers.Layer.Vector, OpenLayers.Layer.Markers, {
/** WFS layer is never a base layer.
*
* @type Boolean
/**
* APIProperty: isBaseLayer
* {Boolean} WFS layer is not a base layer by default.
*/
isBaseLayer: false,
/** 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: 2,
/** Hashtable of default key/value parameters
* @final @type Object */
/**
* Property: DEFAULT_PARAMS
* {Object} Hashtable of default key/value parameters
*/
DEFAULT_PARAMS: { service: "WFS",
version: "1.0.0",
request: "GetFeature"
},
/**
* If featureClass is defined, an old-style markers based
* WFS layer is created instead of a new-style vector layer.
* If sent, this should be a subclass of OpenLayers.Feature
*
* @type OpenLayers.Feature
* APIProperty: featureClass
* {<OpenLayers.Feature>} If featureClass is defined, an old-style markers
* based WFS layer is created instead of a new-style vector layer. If
* sent, this should be a subclass of OpenLayers.Feature
*/
featureClass: null,
/**
* Should be calculated automatically.
*
* @type Boolean
* Property: vectorMode
* {Boolean} Should be calculated automatically.
*/
vectorMode: true,
/**
* @constructor
* Constructor: OpenLayers.Layer.WFS
*
* @param {String} name
* @param {String} url
* @param {Object} params
* @param {Object} options Hashtable of extra options to tag onto the layer
* Parameters:
* name - {String}
* url - {String}
* params - {Object}
* options - {Object} Hashtable of extra options to tag onto the layer
*/
initialize: function(name, url, params, options) {
if (options == undefined) { options = {}; }
@@ -93,7 +101,7 @@ OpenLayers.Layer.WFS.prototype =
/**
*
* APIMethod: destroy
*/
destroy: function() {
if (this.vectorMode) {
@@ -104,7 +112,10 @@ OpenLayers.Layer.WFS.prototype =
},
/**
* @param {OpenLayers.Map} map
* Method: setMap
*
* Parameters:
* map - {<OpenLayers.Map>}
*/
setMap: function(map) {
if (this.vectorMode) {
@@ -115,9 +126,12 @@ OpenLayers.Layer.WFS.prototype =
},
/**
* @param {OpenLayers.Bounds} bounds
* @param {Boolean} zoomChanged
* @param {Boolean} dragging
* Method: moveTo
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* zoomChanged - {Boolean}
* dragging - {Boolean}
*/
moveTo:function(bounds, zoomChanged, dragging) {
if (this.vectorMode) {
@@ -204,6 +218,7 @@ OpenLayers.Layer.WFS.prototype =
},
/**
* Method: onMapResize
* Call the onMapResize method of the appropriate parent class.
*/
onMapResize: function() {
@@ -215,10 +230,13 @@ OpenLayers.Layer.WFS.prototype =
},
/**
* @param {Object} obj
* APIMethod: clone
*
* Parameters:
* obj - {Object}
*
* @returns An exact clone of this OpenLayers.Layer.WMS
* @type OpenLayers.Layer.WMS
* Returns:
* {<OpenLayers.Layer.WFS>} LAn exact clone of this OpenLayers.Layer.WFS
*/
clone: function (obj) {
@@ -241,16 +259,17 @@ OpenLayers.Layer.WFS.prototype =
return obj;
},
/** 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
*/
/**
* 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.
*
* Parameters:
* newParams - {Object}
*/
getFullRequestString:function(newParams) {
var projection = this.map.getProjection();
this.params.SRS = (projection == "none") ? null : projection;
@@ -258,7 +277,11 @@ OpenLayers.Layer.WFS.prototype =
return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(
this, arguments);
},
/**
* APIMethod: commit
* Write out the data to a WFS server.
*/
commit: function() {
if (!this.writer) {
this.writer = new OpenLayers.Format.WFS({},this);
@@ -288,9 +311,11 @@ OpenLayers.Layer.WFS.prototype =
},
/**
* Method: commitSuccess
* Called when the Ajax request returns a response
*
* @param {XmlNode} response from server
* Parameters:
* response - {XmlNode} from server
*/
commitSuccess: function(request) {
var response = request.responseText;
@@ -309,18 +334,22 @@ OpenLayers.Layer.WFS.prototype =
},
/**
* Method: commitFailure
* Called when the Ajax request fails
*
* @param {XmlNode} response from server
* Parameters:
* response - {XmlNode} from server
*/
commitFailure: function(request) {},
/**
* APIMethod: commitReport
* Called with a 'success' message if the commit succeeded, otherwise
* a failure message, and the full text as a second parameter.
* a failure message, and the full request text as a second parameter.
* Override this function to provide custom transaction reporting.
*
* @param {String} string reporting string
* @param {String} response full XML response
* string - {String} reporting string
* response - {String} full XML response
*/
commitReport: function(string, response) {
alert(string);
@@ -328,6 +357,7 @@ OpenLayers.Layer.WFS.prototype =
/**
* APIMethod: refresh
* Refreshes all the features of the layer
*/
refresh: function() {