Features.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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/ArcXML.js
  7. */
  8. /**
  9. * Class: OpenLayers.Format.ArcXML.Features
  10. * Read/Write ArcXML features. Create a new instance with the
  11. * <OpenLayers.Format.ArcXML.Features> constructor.
  12. *
  13. * Inherits from:
  14. * - <OpenLayers.Format.XML>
  15. */
  16. OpenLayers.Format.ArcXML.Features = OpenLayers.Class(OpenLayers.Format.XML, {
  17. /**
  18. * Constructor: OpenLayers.Format.ArcXML.Features
  19. * Create a new parser/writer for ArcXML Features. Create an instance of this class
  20. * to get a set of features from an ArcXML response.
  21. *
  22. * Parameters:
  23. * options - {Object} An optional object whose properties will be set on
  24. * this instance.
  25. */
  26. /**
  27. * APIMethod: read
  28. * Read data from a string of ArcXML, and return a set of OpenLayers features.
  29. *
  30. * Parameters:
  31. * data - {String} or {DOMElement} data to read/parse.
  32. *
  33. * Returns:
  34. * {Array(<OpenLayers.Feature.Vector>)} A collection of features.
  35. */
  36. read: function(data) {
  37. var axl = new OpenLayers.Format.ArcXML();
  38. var parsed = axl.read(data);
  39. return parsed.features.feature;
  40. }
  41. });