ZoomToMaxExtent.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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.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, {
  18. /**
  19. * Property: type
  20. * {String} The type of <OpenLayers.Control> -- When added to a
  21. * <Control.Panel>, 'type' is used by the panel to determine how to
  22. * handle our events.
  23. */
  24. type: OpenLayers.Control.TYPE_BUTTON,
  25. /*
  26. * Method: trigger
  27. * Do the zoom.
  28. */
  29. trigger: function() {
  30. if (this.map) {
  31. this.map.zoomToMaxExtent();
  32. }
  33. },
  34. CLASS_NAME: "OpenLayers.Control.ZoomToMaxExtent"
  35. });