Symbolizer.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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/BaseTypes/Class.js
  7. */
  8. /**
  9. * Class: OpenLayers.Symbolizer
  10. * Base class representing a symbolizer used for feature rendering.
  11. */
  12. OpenLayers.Symbolizer = OpenLayers.Class({
  13. /**
  14. * APIProperty: zIndex
  15. * {Number} The zIndex determines the rendering order for a symbolizer.
  16. * Symbolizers with larger zIndex values are rendered over symbolizers
  17. * with smaller zIndex values. Default is 0.
  18. */
  19. zIndex: 0,
  20. /**
  21. * Constructor: OpenLayers.Symbolizer
  22. * Instances of this class are not useful. See one of the subclasses.
  23. *
  24. * Parameters:
  25. * config - {Object} An object containing properties to be set on the
  26. * symbolizer. Any documented symbolizer property can be set at
  27. * construction.
  28. *
  29. * Returns:
  30. * A new symbolizer.
  31. */
  32. initialize: function(config) {
  33. OpenLayers.Util.extend(this, config);
  34. },
  35. /**
  36. * APIMethod: clone
  37. * Create a copy of this symbolizer.
  38. *
  39. * Returns a symbolizer of the same type with the same properties.
  40. */
  41. clone: function() {
  42. var Type = eval(this.CLASS_NAME);
  43. return new Type(OpenLayers.Util.extend({}, this));
  44. },
  45. CLASS_NAME: "OpenLayers.Symbolizer"
  46. });