ZoomToMaxExtent.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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/Control/Button.js
  7. */
  8. /**
  9. * Class: OpenLayers.Control.ZoomToMaxExtent
  10. * The ZoomToMaxExtent control is a button that zooms out to the maximum
  11. * extent of the map. It is designed to be used with a
  12. * <OpenLayers.Control.Panel>.
  13. *
  14. * Inherits from:
  15. * - <OpenLayers.Control>
  16. */
  17. OpenLayers.Control.ZoomToMaxExtent = OpenLayers.Class(OpenLayers.Control.Button, {
  18. /**
  19. * Method: trigger
  20. *
  21. * Called whenever this control is being rendered inside of a panel and a
  22. * click occurs on this controls element. Actually zooms to the maximum
  23. * extent of this controls map.
  24. */
  25. trigger: function() {
  26. if (this.map) {
  27. this.map.zoomToMaxExtent();
  28. }
  29. },
  30. CLASS_NAME: "OpenLayers.Control.ZoomToMaxExtent"
  31. });