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