ZoomPanel.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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/Control/Panel.js
  7. * @requires OpenLayers/Control/ZoomIn.js
  8. * @requires OpenLayers/Control/ZoomOut.js
  9. * @requires OpenLayers/Control/ZoomToMaxExtent.js
  10. */
  11. /**
  12. * Class: OpenLayers.Control.ZoomPanel
  13. * The ZoomPanel control is a compact collecton of 3 zoom controls: a
  14. * <OpenLayers.Control.ZoomIn>, a <OpenLayers.Control.ZoomToMaxExtent>, and a
  15. * <OpenLayers.Control.ZoomOut>. By default it is drawn in the upper left
  16. * corner of the map.
  17. *
  18. * Note:
  19. * If you wish to use this class with the default images and you want
  20. * it to look nice in ie6, you should add the following, conditionally
  21. * added css stylesheet to your HTML file:
  22. *
  23. * (code)
  24. * <!--[if lte IE 6]>
  25. * <link rel="stylesheet" href="../theme/default/ie6-style.css" type="text/css" />
  26. * <![endif]-->
  27. * (end)
  28. *
  29. * Inherits from:
  30. * - <OpenLayers.Control.Panel>
  31. */
  32. OpenLayers.Control.ZoomPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
  33. /**
  34. * Constructor: OpenLayers.Control.ZoomPanel
  35. * Add the three zooming controls.
  36. *
  37. * Parameters:
  38. * options - {Object} An optional object whose properties will be used
  39. * to extend the control.
  40. */
  41. initialize: function(options) {
  42. OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
  43. this.addControls([
  44. new OpenLayers.Control.ZoomIn(),
  45. new OpenLayers.Control.ZoomToMaxExtent(),
  46. new OpenLayers.Control.ZoomOut()
  47. ]);
  48. },
  49. CLASS_NAME: "OpenLayers.Control.ZoomPanel"
  50. });