SLD.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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/XML/VersionedOGC.js
  7. * @requires OpenLayers/Style.js
  8. * @requires OpenLayers/Rule.js
  9. * @requires OpenLayers/Filter/FeatureId.js
  10. * @requires OpenLayers/Filter/Logical.js
  11. * @requires OpenLayers/Filter/Comparison.js
  12. * @requires OpenLayers/Filter/Spatial.js
  13. */
  14. /**
  15. * Class: OpenLayers.Format.SLD
  16. * Read/Write SLD. Create a new instance with the <OpenLayers.Format.SLD>
  17. * constructor.
  18. *
  19. * Inherits from:
  20. * - <OpenLayers.Format.XML.VersionedOGC>
  21. */
  22. OpenLayers.Format.SLD = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, {
  23. /**
  24. * APIProperty: profile
  25. * {String} If provided, use a custom profile.
  26. *
  27. * Currently supported profiles:
  28. * - GeoServer - parses GeoServer vendor specific capabilities for SLD.
  29. */
  30. profile: null,
  31. /**
  32. * APIProperty: defaultVersion
  33. * {String} Version number to assume if none found. Default is "1.0.0".
  34. */
  35. defaultVersion: "1.0.0",
  36. /**
  37. * APIProperty: stringifyOutput
  38. * {Boolean} If true, write will return a string otherwise a DOMElement.
  39. * Default is true.
  40. */
  41. stringifyOutput: true,
  42. /**
  43. * APIProperty: namedLayersAsArray
  44. * {Boolean} Generate a namedLayers array. If false, the namedLayers
  45. * property value will be an object keyed by layer name. Default is
  46. * false.
  47. */
  48. namedLayersAsArray: false,
  49. /**
  50. * APIMethod: write
  51. * Write a SLD document given a list of styles.
  52. *
  53. * Parameters:
  54. * sld - {Object} An object representing the SLD.
  55. * options - {Object} Optional configuration object.
  56. *
  57. * Returns:
  58. * {String} An SLD document string.
  59. */
  60. /**
  61. * APIMethod: read
  62. * Read and SLD doc and return an object representing the SLD.
  63. *
  64. * Parameters:
  65. * data - {String | DOMElement} Data to read.
  66. * options - {Object} Options for the reader.
  67. *
  68. * Returns:
  69. * {Object} An object representing the SLD.
  70. */
  71. CLASS_NAME: "OpenLayers.Format.SLD"
  72. });