v1.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
  2. * full list of contributors). Published under the 2-clause BSD license.
  3. * See license.txt in the OpenLayers distribution or repository for the
  4. * full text of the license. */
  5. /**
  6. * @requires OpenLayers/Format/WCSCapabilities.js
  7. */
  8. /**
  9. * Class: OpenLayers.Format.WCSCapabilities.v1
  10. * Abstract class not to be instantiated directly.
  11. *
  12. * Inherits from:
  13. * - <OpenLayers.Format.XML>
  14. */
  15. OpenLayers.Format.WCSCapabilities.v1 = OpenLayers.Class(
  16. OpenLayers.Format.XML, {
  17. regExes: {
  18. trimSpace: (/^\s*|\s*$/g),
  19. splitSpace: (/\s+/)
  20. },
  21. /**
  22. * Property: defaultPrefix
  23. */
  24. defaultPrefix: "wcs",
  25. /**
  26. * APIMethod: read
  27. * Read capabilities data from a string, and return a list of coverages.
  28. *
  29. * Parameters:
  30. * data - {String} or {DOMElement} data to read/parse.
  31. *
  32. * Returns:
  33. * {Array} List of named coverages.
  34. */
  35. read: function(data) {
  36. if(typeof data == "string") {
  37. data = OpenLayers.Format.XML.prototype.read.apply(this, [data]);
  38. }
  39. var raw = data;
  40. if(data && data.nodeType == 9) {
  41. data = data.documentElement;
  42. }
  43. var capabilities = {};
  44. this.readNode(data, capabilities);
  45. return capabilities;
  46. },
  47. CLASS_NAME: "OpenLayers.Format.WCSCapabilities.v1"
  48. });