This pull requests suggests that the controls Pan, ZoomIn, ZoomOut and ZoomToMaxExtent should inherit from OpenLayers.Control.Button instead of from OpenLayers.Control. This let's us define and set the type property only once and not separately in all of the subclasses.
Also included in this request are newly added testcases for all of the above changed classes. Previously none were existing for these.
Some of the controls have also been changed to not do anything (including not to throw exceptions) when their respective trigger-method would be called prior the control being added to a map.
All relevant tests pass in Chromium 11, Firefox 11 (both on Linux-Ubuntu) and Internet Explorer 6 and 8 (both on Windows XP).
Add tests for the ZoomToMaxExtent control.
The ZoomToMaxExtent control should extend the OpenLayers.Control.Button
and not OpenLayers.Control.
Added tests for ZoomOut control.
Changed ZoomOut control to inherit from OpenLayers.Control.Button.
Added tests for the 'type' property which is now inherited from the
Added tests for ZoomIn control.
Changed ZoomIn control to inherit from OpenLayers.Control.Button.
Removed erroneously commited alert-statements in tests.
The changed controls should also check whether they have correctly
inherited the property 'type' of the new parent class.
Added tests for OpenLayers.Control.Pan.
Protect the trigger action of pan control by checking whether
we were added to a map prior to calling this.map.pan().
Changed Pan control to inherit from OpenLayers.Control.Button.
Why this if? (IMHO the Control.Panel can not trigger it before being on the map)
I think it doesn't hurt and the cotrols should be usable even when added directly to a map and not via a panel.
Merge branch 'master' of https://github.com/openlayers/openlayers int…
Merge branch 'control-inheritance' of https://github.com/marcjansen/o…
…penlayers into control-inheritance
As a post-facto review, these changes look good to me.