CSW.js 870 B

123456789101112131415161718192021222324252627282930
  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/Protocol.js
  7. */
  8. /**
  9. * Class: OpenLayers.Protocol.CSW
  10. * Used to create a versioned CSW protocol. Default version is 2.0.2.
  11. */
  12. OpenLayers.Protocol.CSW = function(options) {
  13. options = OpenLayers.Util.applyDefaults(
  14. options, OpenLayers.Protocol.CSW.DEFAULTS
  15. );
  16. var cls = OpenLayers.Protocol.CSW["v"+options.version.replace(/\./g, "_")];
  17. if(!cls) {
  18. throw "Unsupported CSW version: " + options.version;
  19. }
  20. return new cls(options);
  21. };
  22. /**
  23. * Constant: OpenLayers.Protocol.CSW.DEFAULTS
  24. */
  25. OpenLayers.Protocol.CSW.DEFAULTS = {
  26. "version": "2.0.2"
  27. };