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

@@ -3,32 +3,41 @@
* for the full text of the license. */
/**
* Create a vector layer by parsing a GML file. The GML file is
* passed in as a parameter.
* @class
*
* @requires OpenLayers/Layer/Vector.js
* @requires OpenLayers/Ajax.js
* Class: OpenLayers.Layer.GML
* Create a vector layer by parsing a GML file. The GML file is
* passed in as a parameter.
*
* Inherits from:
* - <OpenLayers.Layer.Vector>
*/
OpenLayers.Layer.GML = OpenLayers.Class.create();
OpenLayers.Layer.GML.prototype =
OpenLayers.Class.inherit( OpenLayers.Layer.Vector, {
/**
* Flag for whether the GML data has been loaded yet.
* @type Boolean
* Property: loaded
* {Boolean} Flag for whether the GML data has been loaded yet.
*/
loaded: false,
/**
* APIProperty: format
* {<OpenLayers.Format>} The format you want the data to be parsed with.
*/
format: null,
/**
* @constructor
*
* @param {String} name
* @param {String} url URL of a GML file.
* @param {Object} options Hashtable of extra options to tag onto the layer.
* Options renderer {Object}: Typically SvgRenderer or VmlRenderer.
* Constructor: OpenLayers.Layer.GML
* Load and parse a single file on the web, according to the format
* provided via the 'format' option, defaulting to GML.
*
* Parameters:
* name - {String}
* url - {String} URL of a GML file.
* options - {Object} Hashtable of extra options to tag onto the layer.
*/
initialize: function(name, url, options) {
var newArguments = new Array()
@@ -38,14 +47,16 @@ OpenLayers.Layer.GML.prototype =
},
/**
* APIMethod: setVisibility
* Set the visibility flag for the layer and hide/show&redraw accordingly.
* Fire event unless otherwise specified
* GML will be loaded if the layer is being made visible for the first
* time.
*
* @param {Boolean} visible Whether or not to display the layer
* Parameters:
* visible - {Boolean} Whether or not to display the layer
* (if in range)
* @param {Boolean} noEvent
* noEvent - {Boolean}
*/
setVisibility: function(visibility, noEvent) {
OpenLayers.Layer.Vector.prototype.setVisibility.apply(this, arguments);
@@ -56,11 +67,14 @@ OpenLayers.Layer.GML.prototype =
},
/**
* Method: moveTo
* If layer is visible and GML has not been loaded, load GML, then load GML
* and call OpenLayers.Layer.Vector.moveTo() to redraw at the new location.
* @param {Object} bounds
* @param {Object} zoomChanged
* @param {Object} minor
*
* Parameters:
* bounds - {Object}
* zoomChanged - {Object}
* minor - {Object}
*/
moveTo:function(bounds, zoomChanged, minor) {
OpenLayers.Layer.Vector.prototype.moveTo.apply(this, arguments);
@@ -73,6 +87,9 @@ OpenLayers.Layer.GML.prototype =
}
},
/**
* Method: loadGML
*/
loadGML: function() {
if (!this.loaded) {
var results = OpenLayers.loadURL(this.url, null, this, this.requestSuccess, this.requestFailure);
@@ -82,10 +99,12 @@ OpenLayers.Layer.GML.prototype =
/**
* Method: requestSuccess
* Process GML after it has been loaded.
* Called by initialise() and loadUrl() after the GML has been loaded.
* @private
* @param {String} request
*
* Parameters:
* request - {String}
*/
requestSuccess:function(request) {
var doc = request.responseXML;
@@ -99,10 +118,12 @@ OpenLayers.Layer.GML.prototype =
},
/**
* Method: requestFailure
* Process a failed loading of GML.
* Called by initialise() and loadUrl() if there was a problem loading GML.
* @private
* @param {String} request
*
* Parameters:
* request - {String}
*/
requestFailure: function(request) {
alert("Error in loading GML file "+this.url);