SOS.js 953 B

123456789101112131415161718192021222324252627282930313233
  1. /* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for
  2. * full list of contributors). Published under the Clear BSD license.
  3. * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
  4. * full text of the license. */
  5. /**
  6. * @requires OpenLayers/Protocol.js
  7. */
  8. /**
  9. * Function: OpenLayers.Protocol.SOS
  10. * Used to create a versioned SOS protocol. Default version is 1.0.0.
  11. *
  12. * Returns:
  13. * {<OpenLayers.Protocol>} An SOS protocol for the given version.
  14. */
  15. OpenLayers.Protocol.SOS = function(options) {
  16. options = OpenLayers.Util.applyDefaults(
  17. options, OpenLayers.Protocol.SOS.DEFAULTS
  18. );
  19. var cls = OpenLayers.Protocol.SOS["v"+options.version.replace(/\./g, "_")];
  20. if(!cls) {
  21. throw "Unsupported SOS version: " + options.version;
  22. }
  23. return new cls(options);
  24. };
  25. /**
  26. * Constant: OpenLayers.Protocol.SOS.DEFAULTS
  27. */
  28. OpenLayers.Protocol.SOS.DEFAULTS = {
  29. "version": "1.0.0"
  30. };