Changed ZoomOut control to inherit from OpenLayers.Control.Button.

This commit is contained in:
Marc Jansen
2012-04-17 08:11:48 +02:00
parent c40bdc90e9
commit 3dfa3fd157
+5 -11
View File
@@ -4,7 +4,7 @@
* full text of the license. */ * full text of the license. */
/** /**
* @requires OpenLayers/Control.js * @requires OpenLayers/Control/Button.js
*/ */
/** /**
@@ -14,21 +14,15 @@
* Inherits from: * Inherits from:
* - <OpenLayers.Control> * - <OpenLayers.Control>
*/ */
OpenLayers.Control.ZoomOut = OpenLayers.Class(OpenLayers.Control, { OpenLayers.Control.ZoomOut = OpenLayers.Class(OpenLayers.Control.Button, {
/**
* Property: type
* {String} The type of <OpenLayers.Control> -- When added to a
* <Control.Panel>, 'type' is used by the panel to determine how to
* handle our events.
*/
type: OpenLayers.Control.TYPE_BUTTON,
/** /**
* Method: trigger * Method: trigger
*/ */
trigger: function(){ trigger: function(){
this.map.zoomOut(); if (this.map) {
this.map.zoomOut();
}
}, },
CLASS_NAME: "OpenLayers.Control.ZoomOut" CLASS_NAME: "OpenLayers.Control.ZoomOut"