diff options
author | Chris Schlaeger <chris@linux.com> | 2014-08-12 21:56:44 +0200 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2014-08-12 21:56:44 +0200 |
commit | ea346a785dc1b3f7c156f6fc33da634e1f1a627b (patch) | |
tree | af67530553d20b6e82ad60fd79593e9c4abf5565 /misc/openlayers/lib/OpenLayers/Format/OWSCommon.js | |
parent | 59741cd535c47f25971bf8c32b25da25ceadc6d5 (diff) | |
download | postrunner-ea346a785dc1b3f7c156f6fc33da634e1f1a627b.zip |
Adding jquery, flot and openlayers to be included with the GEM.v0.0.4
Diffstat (limited to 'misc/openlayers/lib/OpenLayers/Format/OWSCommon.js')
-rw-r--r-- | misc/openlayers/lib/OpenLayers/Format/OWSCommon.js | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/misc/openlayers/lib/OpenLayers/Format/OWSCommon.js b/misc/openlayers/lib/OpenLayers/Format/OWSCommon.js new file mode 100644 index 0000000..fd71820 --- /dev/null +++ b/misc/openlayers/lib/OpenLayers/Format/OWSCommon.js @@ -0,0 +1,78 @@ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the 2-clause BSD license. + * See license.txt in the OpenLayers distribution or repository for the + * full text of the license. */ + +/** + * @requires OpenLayers/Format/XML/VersionedOGC.js + */ + +/** + * Class: OpenLayers.Format.OWSCommon + * Read OWSCommon. Create a new instance with the <OpenLayers.Format.OWSCommon> + * constructor. + * + * Inherits from: + * - <OpenLayers.Format.XML.VersionedOGC> + */ +OpenLayers.Format.OWSCommon = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, { + + /** + * APIProperty: defaultVersion + * {String} Version number to assume if none found. Default is "1.0.0". + */ + defaultVersion: "1.0.0", + + /** + * Constructor: OpenLayers.Format.OWSCommon + * Create a new parser for OWSCommon. + * + * Parameters: + * options - {Object} An optional object whose properties will be set on + * this instance. + */ + + /** + * Method: getVersion + * Returns the version to use. Subclasses can override this function + * if a different version detection is needed. + * + * Parameters: + * root - {DOMElement} + * options - {Object} Optional configuration object. + * + * Returns: + * {String} The version to use. + */ + getVersion: function(root, options) { + var version = this.version; + if(!version) { + // remember version does not correspond to the OWS version + // it corresponds to the WMS/WFS/WCS etc. request version + var uri = root.getAttribute("xmlns:ows"); + // the above will fail if the namespace prefix is different than + // ows and if the namespace is declared on a different element + if (uri && uri.substring(uri.lastIndexOf("/")+1) === "1.1") { + version ="1.1.0"; + } + if(!version) { + version = this.defaultVersion; + } + } + return version; + }, + + /** + * APIMethod: read + * Read an OWSCommon document and return an object. + * + * Parameters: + * data - {String | DOMElement} Data to read. + * options - {Object} Options for the reader. + * + * Returns: + * {Object} An object representing the structure of the document. + */ + + CLASS_NAME: "OpenLayers.Format.OWSCommon" +}); |