CSWGetDomain.js 991 B

12345678910111213141516171819202122232425262728293031323334
  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.js
  7. */
  8. /**
  9. * Class: OpenLayers.Format.CSWGetDomain
  10. * Default version is 2.0.2.
  11. *
  12. * Returns:
  13. * {<OpenLayers.Format>} A CSWGetDomain format of the given version.
  14. */
  15. OpenLayers.Format.CSWGetDomain = function(options) {
  16. options = OpenLayers.Util.applyDefaults(
  17. options, OpenLayers.Format.CSWGetDomain.DEFAULTS
  18. );
  19. var cls = OpenLayers.Format.CSWGetDomain["v"+options.version.replace(/\./g, "_")];
  20. if(!cls) {
  21. throw "Unsupported CSWGetDomain version: " + options.version;
  22. }
  23. return new cls(options);
  24. };
  25. /**
  26. * Constant: DEFAULTS
  27. * {Object} Default properties for the CSWGetDomain format.
  28. */
  29. OpenLayers.Format.CSWGetDomain.DEFAULTS = {
  30. "version": "2.0.2"
  31. };