OpenLayers OpenLayers

Changeset 5990

Show
Ignore:
Timestamp:
02/05/08 01:34:20 (1 year ago)
Author:
euzuro
Message:

give the navigation control a proper destroy and also give it a test file while we're at it. (Closes #1289)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Control/Navigation.js

    r5982 r5990  
    6363    destroy: function() { 
    6464        OpenLayers.Control.prototype.destroy.apply(this,arguments); 
     65 
    6566        this.deactivate(); 
    66         this.dragPan.destroy(); 
    67         this.wheelHandler.destroy(); 
    68         this.clickHandler.destroy(); 
    69         this.zoomBox.destroy(); 
     67 
     68        if (this.dragPan) { 
     69            this.dragPan.destroy(); 
     70        } 
     71        this.dragPan = null; 
     72 
     73        if (this.wheelHandler) { 
     74            this.wheelHandler.destroy(); 
     75        } 
     76        this.wheelHandler = null; 
     77 
     78        if (this.clickHandler) { 
     79            this.clickHandler.destroy(); 
     80        } 
     81        this.clickHandler = null; 
     82         
     83        if (this.zoomBox) { 
     84            this.zoomBox.destroy(); 
     85        } 
     86        this.zoomBox = null; 
    7087    }, 
    7188     
  • trunk/openlayers/tests/list-tests.html

    r5922 r5990  
    8484    <li>Control/test_MousePosition.html</li> 
    8585    <li>Control/test_MouseToolbar.html</li> 
     86    <li>Control/test_Navigation.html</li> 
    8687    <li>Control/test_NavToolbar.html</li> 
    8788    <li>Control/test_OverviewMap.html</li>